<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Surkov.alexander</id>
	<title>MozillaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Surkov.alexander"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/Special:Contributions/Surkov.alexander"/>
	<updated>2026-09-04T06:23:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1207410</id>
		<title>Modules/Core</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1207410"/>
		<updated>2019-02-08T14:37:24Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Only module owners may edit this page.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
They may:&lt;br /&gt;
&lt;br /&gt;
* update any information about their module except the name of the owner&lt;br /&gt;
* add or remove sub-modules&lt;br /&gt;
* change the owner of a sub-module &lt;br /&gt;
* add emeritus owners or peers&lt;br /&gt;
&lt;br /&gt;
Other changes, including changes of module owner or addition/removal of modules, must be agreed with the Module Ownership Module group, probably via a discussion in [https://www.mozilla.org/about/forums/#governance mozilla.governance].&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Accessibility&lt;br /&gt;
|description=Support for platform accessibility APIs. Accessibility APIs are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and UI controls, as well as important events like changes of focus.&lt;br /&gt;
|owner=[mailto:jteh@mozilla.com Jamie Teh]&lt;br /&gt;
|peers=[mailto:dbolter@mozilla.com David Bolter], [mailto:eitan@monotonous.org Eitan Isaacson], [mailto:jteh@mozilla.com James Teh],  [mailto:mzehe@mozilla.com Marco Zehe], [mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|ownersemeritus=[mailto:aaron@moonset.net. Aaron Leventhal], [mailto:surkov.alexander@gmail.com Alexander Surkov]&lt;br /&gt;
|peersemeritus=[mailto:tbsaunde+mozbugs@tbsaunde.org Trevor Saunders], [mailto:ginn.chen@oracle.com Ginn Chen], Evan Yan&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Animation&lt;br /&gt;
|description=Declarative animations: CSS animations, CSS transitions, Web Animations API, and off-main thread animations.&lt;br /&gt;
|owner=[mailto:bbirtles@mozilla.com Brian Birtles] (:birtles)&lt;br /&gt;
|peers=[mailto:hiro@mozilla.com Hiroyuki Ikezoe] (:hiro), [mailto:mwoodrow@mozilla.com Matt Woodrow] (:mattwoodrow)&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=dom/animation; and animation-related and interpolation-related code in layout/style, gfx/layers, servo/components/style and servo/ports/gecko&lt;br /&gt;
|components=Core::DOM::Animation, Core::CSS Parsing and Computation (for CSS animations/transitions related bugs)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Anti-Tracking&lt;br /&gt;
|description=Tracking detection and content-blocking.&lt;br /&gt;
|owner=[mailto:amarchesini@Mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:dlee@mozilla.com Dimi Lee], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:ewright@mozilla.com Erica Wright], [mailto:jhofmann@mozilla.com Johann Hofmann]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=toolkit/components/antitracking/, several files under browser/ and netwerk/url-classifier/&lt;br /&gt;
|components=Core::Privacy: Anti-Tracking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Browser WebAPI&lt;br /&gt;
|description=Web API for rendering apps, browser windows and widgets.&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:fabrice@mozilla.com Fabrice Desré]&lt;br /&gt;
|ownersemeritus=[mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/browser-element/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build and Release Tools&lt;br /&gt;
|description=Tools related to build and release automation and configuration of release builds.&lt;br /&gt;
|owner=[mailto:nthomas@mozilla.com Nick Thomas]&lt;br /&gt;
|peers=[mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:coop@mozilla.com Chris Cooper]&lt;br /&gt;
|group=release-engineering&lt;br /&gt;
|source_dirs=browser/config/mozconfigs/, mobile/android/config/mozconfigs/, xulrunner/config/mozconfigs/, b2g/config/, tools/update-packaging/&lt;br /&gt;
|url=https://wiki.mozilla.org/ReleaseEngineering&lt;br /&gt;
|components=Release Engineering::*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config&lt;br /&gt;
|description=The build system for Gecko and several mozilla.org hosted Gecko-based applications.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc] (:gps)&lt;br /&gt;
|peers=[mailto:mh@glandium.org Mike Hommey] (:glandium), [mailto:mshal@mozilla.com Mike Shal] (:mshal), [mailto:ted@mielczarek.org Ted Mielczarek] (:ted), [mailto:cmanchester@mozilla.com Chris Manchester](:chmanchester), [mailto:nfroyd@mozilla.com Nathan Froyd] (:froydnj), [mailto:dmajor@mozilla.com David Major] (:dmajor), [mailto:rgiles@mozilla.com Ralph Giles] (:rillian)&lt;br /&gt;
|ownersemeritus=Ted Mielczarek (2008-[https://blog.mozilla.org/ted/2013/03/07/gregory-szorc-is-now-the-build-config-module-owner/ 2013]), Benjamin Smedberg (???-[http://benjamin.smedbergs.us/blog/2008-04-30/more-changing-of-the-guard-ted-mielczarek/ 2008]), &lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|source_dirs=build/, config/, python/mozbuild, tools/cross-commit, tools/cvs2hg-import.py, tools/cvsmgmt/, tools/elf-dynstr-gc/, tools/trees.pl, browser/config/mozconfigs/, mobile/config/mozconfigs/, xulrunner/config/mozconfigs/&lt;br /&gt;
|url=http://www.mozilla.org/build/&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Code Analysis and Debugging Tools&lt;br /&gt;
|description=Tools for debugging Mozilla code or for analyzing speed, memory use, and other characteristics of it.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-performance&lt;br /&gt;
|source_dirs=tools/codesighs/, tools/debug/, tools/dreftool/, tools/dumpdeps/, tools/footprint/, tools/jprof/, tools/leaky/, tools/memory/, tools/module-deps/, tools/performance/, tools/post_compile/, tools/preloader/, tools/rb/, tools/reorder/, tools/trace-malloc/, tools/uuiddeps/, &lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content HTTP Headers&lt;br /&gt;
|description=HTTP headers related to content, e.g. User-Agent, Content-Type, Accept. (Transport-related headers are the responsibility of the Necko module owner.)&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:lmandel@mozilla.com Lawrence Mandel]&lt;br /&gt;
|ownersemeritus=[mailto:gerv@mozilla.org Gervase Markham]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs= &lt;br /&gt;
|url=https://developer.mozilla.org/en/Gecko_user_agent_string_reference&lt;br /&gt;
|components=Core::Networking: HTTP&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content Security&lt;br /&gt;
|description=Native content-based security features enforced in the ContentSecurityManager, including: Content Security Policy (CSP), Mixed Content Blocker (MCB), Subresource Integrity (SRI), Cross-Origin Resource Sharing (CORS) and top-level data: URI blocking.&lt;br /&gt;
|owner=[mailto:ckerschbaumer@mozilla.com Christoph Kerschbaumer]&lt;br /&gt;
|peers=[mailto:tvyas@mozilla.com Tanvi Vyas], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:amarchesini@mozilla.com Andrea Marchesini], [mailto:jkt@mozilla.com Jonathan Kingston]&lt;br /&gt;
|peersemeritus=[mailto:mozilla@sidstamm.com Sid Stamm], [mailto:jonas@sicking.cc Jonas Sicking], François Marier&lt;br /&gt;
|group=dev-security&lt;br /&gt;
|source_dirs=dom/security&lt;br /&gt;
|components=Core::DOM: Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cookies and Permissions&lt;br /&gt;
|description=&lt;br /&gt;
|owner=Monica Chew&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.com Josh Matthews], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:mconnor@steelgryphon.com Mike Connor], [mailto:dwitte@gmail.com Dan Witte], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sdwilsh@shawnwilsher.com Shawn Wilsher (ping on irc)]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=extensions/cookie/, netwerk/cookie/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Networking: Cookies&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cycle Collector&lt;br /&gt;
|description=Code to break and collect objects within reference cycles&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/mccr8/ Andrew McCreight]&lt;br /&gt;
|peers=Peter Van der Beken, Olli Pettay, David Baron&lt;br /&gt;
|source_dirs=xpcom/base/nsCycleCollector.* and some support headers&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=C++/Rust usage, tools, and style&lt;br /&gt;
|description=Aspects of C++ use such as language feature usage, standard library versions/usage, compiler/toolchain versions, formatting and naming style, and aspects of Rust use as needs arise&lt;br /&gt;
|owner=[mailto:nfroyd@mozilla.com Nathan Froyd] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:glandium@mozilla.com Mike Hommey], [mailto:jwalden@mozilla.com Jeff Walden], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|source_dirs=non-third-party C++ and Rust code in the tree&lt;br /&gt;
|components=Various components&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=docshell&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:kyle@nonpolynomial.com Kyle Machulis], [mailto:nika@thelayzells.com Nika Layzell]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:justin.lebar@gmail.com Justin Lebar], [mailto:sawang@mozilla.com Samael Wang]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=docshell/, uriloader/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Document Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Document Object Model&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:hsivonen@iki.fi Henri Sivonen], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:baku@mozilla.com Andrea Marchesini],&lt;br /&gt;
[mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:kyle@nonpolynomial.com Kyle Machulis], [mailto:amccreight@mozilla.com Andrew McCreight], [mailto:nika@thelayzells.com Nika Layzell]&lt;br /&gt;
|ownersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|peersemeritus=[mailto:justin.lebar@gmail.com Justin Lebar], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:bent.mozilla@gmail.com Ben Turner], [mailto:mounir@lamouri.fr Mounir Lamouri (still active, but slower to respond than previously)], [mailto:me@kylehuey.com Kyle Huey], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:ben@wanderview.com Ben Kelly]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/*, except directories covered by other modules&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM, Core::DOM: CSS Object Model, Core::DOM: Core &amp;amp; HTML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=DOM File&lt;br /&gt;
|description=DOM Blob, File and FileSystem APIs &lt;br /&gt;
|owner=[mailto:amarchesini@Mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:olli@pettay.fi Olli Pettay]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/file, dom/filesystem&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Event Handling&lt;br /&gt;
|description=DOM Events and Event Handling &lt;br /&gt;
|owner=[mailto:olli@pettay.fi Olli Pettay], [mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peersemeritus=[mailto:sshih@mozilla.com Stone Shih]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/events and event handling related code elsewhere &lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: Events, Core::Event Handling&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Workers&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:mrbkap@mozilla.com Blake Kaplan], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:asuth@mozilla.com Andrew Sutherland], [mailto:ytausky@mozilla.com Yaron Tausky]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/workers/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_web_workers&lt;br /&gt;
|components=Core::DOM: Workers&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IndexedDB&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|peers=[mailto:btseng@mozilla.com Bevis Tseng], [mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/indexedDB/&lt;br /&gt;
|url=https://developer.mozilla.org/en/IndexedDB&lt;br /&gt;
|components=Core::DOM: IndexedDB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Editor&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=[mailto:m_kato@ga2.so-net.ne.jp Makoto Kato]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=editor/&lt;br /&gt;
|url=http://www.mozilla.org/editor/&lt;br /&gt;
|components=Core::Editor&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Embedding&lt;br /&gt;
|description=Gecko embedding APIs and frameworks&lt;br /&gt;
|owner=[mailto:myk@mykzilla.org Myk Melez]&lt;br /&gt;
|ownersemeritus=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:bdahl@mozilla.com Brendan Dahl], [mailto:tbsaunde@tbsaunde.org Trevor Saunders]&lt;br /&gt;
|peersemeritus=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=embedding/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Find As You Type&lt;br /&gt;
|description=Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). Currently seeks new owner.&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=extensions/typeaheadfind/&lt;br /&gt;
|url=http://www.mozilla.org/access/type-ahead/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Gecko Profiler&lt;br /&gt;
|description=Gecko&#039;s built-in profiler&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:nnethercote@mozilla.com Nicholas Nethercote], [mailto:jseward@mozilla.com Julian Seward] (LUL), [mailto:kvijayan@mozilla.com Kannan Vijayan] (JS integration), [mailto:shu@mozilla.com Shu-yu Guo] (JS integration), [mailto:tlee@mozilla.com Thinker Lee] (TaskTracer), [mailto:cyu@mozilla.com Cervantes Yu] (TaskTracer), [mailto:b56girard@gmail.com Benoit Girard].&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=tools/profiler/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler&lt;br /&gt;
|components=Core::Gecko Profiler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Geolocation&lt;br /&gt;
|description=Implementation of the Geolocation W3C Spec, location provider apis, and wifi scanning code.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews], [mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner], Garvan Keeley&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/geolocation, dom/system/, netwerk/wifi&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_geolocation&lt;br /&gt;
|components=Core::Geolocation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Global Key Bindings&lt;br /&gt;
|description=Global hot keys in Mozilla for the browser, editor, mail-news and widgets. Does not include underlined menu accelerators and the like, as those are part of i18n.&lt;br /&gt;
|owner=Aaron Leventhal&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=dom/xbl/builtin/&lt;br /&gt;
|url=http://www.mozilla.org/projects/ui/accessibility/mozkeyintro.html&lt;br /&gt;
|components=Core::Keyboard: Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Graphics&lt;br /&gt;
|description=Mozilla graphics API&lt;br /&gt;
|owner=[mailto:jrmuizel@mozilla.com Jeff Muizelaar](Thebes, QCMS, YCbCr, Cairo/Pixman, Regions, OS X, Other)&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bas.schouten@live.nl Bas Schouten](Layers, Windows), [mailto:jgilbert@mozilla.com Jeff Gilbert](WebGL, ANGLE), [mailto:mwoodrow@mozilla.com Matt Woodrow](Layers API), [mailto:jfkthame@googlemail.com Jonathan Kew](text/fonts), [mailto:nsilva@mozilla.com  Nicolas Silva](MozSurface), [mailto:ncameron@mozilla.com Nick Cameron], [mailto:sikeda@mozilla.com Sotaro Ikeda](B2G), [mailto:jnicol@mozilla.com Jamie Nicol](Android), [mailto:snorp@mozilla.com James Willcox](Android), [mailto:mstange@themasta.com Markus Stange](OS X), [mailto:lsalzman@mozilla.com Lee Salzman](Skia, Canvas2D), [mailto:rhunt@mozilla.com Ryan Hunt](OMTP), [mailto:gwatson@mozilla.com Glenn Watson ](WebRender), [mailto:dmalyshau@mozilla.com Dzmitry Malyshau](WebRender)&lt;br /&gt;
|peersemeritus=[mailto:bgirard@mozilla.com Benoit Girard](Compositor, Performance), [mailto:ajuma.bugzilla@alijuma.com Ali Juma], [mailto:george@mozilla.com George Wright](Canvas2D), [mailto:mchang@mozilla.com Mason Chang], [mailto:dvander@mozilla.com David Anderson], [mailto:clord@mozilla.com Christopher Lord], [mailto:jdaggett@mozilla.com John Daggett](text/fonts), [mailto:bjacob@mozilla.com Benoit Jacob](gfx/gl), [mailto:jdrew@mozilla.com Joe Drew], [mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=gfx/, dom/canvas/&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX https://wiki.mozilla.org/Gecko:Layers https://wiki.mozilla.org/Gecko:2DGraphicsSketch&lt;br /&gt;
|components=Core::Graphics, Core::Graphics: Layers, Core::Graphics: Text, Core::Graphics: WebRender, Core::GFX: Color Management, Core::Canvas: 2D, Core::Canvas: WebGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=APZ (Graphics submodule)&lt;br /&gt;
|description=Asynchronous panning and zooming&lt;br /&gt;
|owner=[mailto:kgupta@mozilla.com Kartikaya Gupta]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:tnikkel@mozilla.com Timothy Nikkel], [mailto:dvander@mozilla.com David Anderson], [mailto:mstange@mozilla.com Markus Stange]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/layers/apz&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/APZ&lt;br /&gt;
|components=Core::Panning and Zooming&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Moz2D (Graphics submodule)&lt;br /&gt;
|description=Platform independent 2D graphics API&lt;br /&gt;
|owner=[mailto:bschouten@mozilla.com Bas Schouten]&lt;br /&gt;
|peers=[mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:gwright@mozilla.com George Wright], [mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/2d&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/Moz2D&lt;br /&gt;
|components=Core::Graphics&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Legacy HTML Parser&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:mrbkap@gmail.com Blake Kaplan]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:rbs@maths.uq.edu.au rbs@maths.uq.edu.au]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|source_dirs=parser/htmlparser&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/doc/parser.html&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HAL&lt;br /&gt;
|description=Hardware Abstraction Layer&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands]&lt;br /&gt;
|peers=[mailto:gsvelto@mozilla.com Gabriele Svelto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=hal/&lt;br /&gt;
|components=Core::Hardware Abstraction Layer (HAL)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HTML Parser&lt;br /&gt;
|description=The HTML Parser transforms HTML source code into a DOM. It conforms to the HTML specification, and is mostly translated automatically from Java to C++.&lt;br /&gt;
|owner=[mailto:hsivonen@iki.fi Henri Sivonen]&lt;br /&gt;
|peers=[mailto:wchen@mozilla.com William Chen]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=parser/html&lt;br /&gt;
|url=http://about.validator.nu/&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=I18N Library&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:hsivonen@hsivonen.fi Henri Sivonen (encoding)], [mailto:jfkthame@gmail.com Jonathan Kew (except to encoding)]&lt;br /&gt;
|peers=[mailto:VYV03354@nifty.ne.jp Masatoshi Kimura], [mailto:gandalf@aviary.pl Zibi Braniecki], [mailto:m_kato@ga2.so-net.ne.jp Makoto Kato]&lt;br /&gt;
|ownersemeritus=[mailto:jshin1987@gmail.com Jungshik Shin], [mailto:smontagu@smontagu.org Simon Montagu]&lt;br /&gt;
|group=dev-i18n&lt;br /&gt;
|source_dirs=intl/&lt;br /&gt;
|url=http://mozilla.org/projects/intl/index.html&lt;br /&gt;
|components=Core::Internationalization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=ImageLib&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:tnikkel@gmail.com Timothy Nikkel]&lt;br /&gt;
|peers=[mailto:aosmond@mozilla.com Andrew Osmond], [mailto:jmuizelaar@mozilla.com Jeff Muizelaar]&lt;br /&gt;
|peersemeritus=[mailto:seth.bugzilla@blackhail.net Seth Fowler], [mailto:netzen@gmail.com Brian Bondy], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/libjpeg/, media/libpng/, image/, modules/zlib/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::ImageLib&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IPC&lt;br /&gt;
|description=Native message-passing between threads and processes&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|ownersemeritus=[mailto:wmccloskey@mozilla.com Bill McCloskey]&lt;br /&gt;
|peers=[mailto:jld@mozilla.com Jed Davis], [mailto:nfroyd@mozilla.com Nathan Froyd], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:amccreight@mozilla.com Andrew McCreight]&lt;br /&gt;
|peersemeritus=[mailto:danderson@mozilla.com David Anderson], [mailto:kchen@mozilla.com Kan-Ru Chen], [mailto:btseng@mozilla.com Bevis Tseng]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/glue/, ipc/ipdl/, ipc/chromium/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript&lt;br /&gt;
|description=JavaScript engine (SpiderMonkey)&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:jdemooij@mozilla.com Jan de Mooij], André Bargull, [mailto:tcampbell@mozilla.com Ted Campbell], [mailto:jcoppeard@mozilla.com Jon Coppeard], [mailto:sphink@gmail.com Steve Fink], [mailto:arai.unmht@gmail.com Tooru Fujisawa], [mailto:khyperia@mozilla.com Ashley Hauck], [mailto:evilpies@gmail.com Tom Schuster], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:jwalden@mit.edu Jeff Walden], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:till@tillschneidereit.net Till Schneidereit], [mailto:efaust@mozilla.com Eric Faust], [mailto:nfitzgerald@mozilla.com Nick Fitzgerald], [mailto:nnethercote@mozilla.com Nick Nethercote], [mailto:luke@mozilla.com Luke Wagner], [mailto:sunfish@mozilla.com Dan Gohman], [mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peersemeritus=[mailto:brendan@mozilla.org Brendan Eich], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:nmatsakis@mozilla.com Niko Matsakis], [mailto:ejpbruel@mozilla.com Eddy Bruel], [mailto:danderson@mozilla.com David Anderson], [mailto:igor@mir2.org Igor Bukanov], Andreas Gal&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey,&lt;br /&gt;
http://developer.mozilla.org/en/docs/About_JavaScript&lt;br /&gt;
|components=Core::JavaScript Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript JIT&lt;br /&gt;
|description=JavaScript engine&#039;s JIT compilers (IonMonkey, Baseline)&lt;br /&gt;
|owner=[mailto:jdemooij@mozilla.com Jan de Mooij]&lt;br /&gt;
|peers=[mailto:bbouvier@mozilla.com Benjamin Bouvier], [mailto:tcampbell@mozilla.com Ted Campbell], [mailto:mgaudet@mozilla.com Matthew Gaudet], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:nicolas.b.pierron@mozilla.com Nicolas Pierron], [mailto:evilpies@gmail.com  Tom Schuster], [mailto:sstangl@mozilla.com Sean Stangl], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:luke@mozilla.com Luke Wagner]&lt;br /&gt;
|peersemeritus=[mailto:danderson@mozilla.com David Anderson], [mailto:hv1989@gmail.com Hannes Verschore]&lt;br /&gt;
|group=dev-tech-js-engine-internals&lt;br /&gt;
|source_dirs=js/src/jit&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey&lt;br /&gt;
|components=Core::JavaScript Engine: JIT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript Debugger Backend&lt;br /&gt;
|description=JavaScript debugging hooks&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:rginda@hacksrus.com Rob Ginda]&lt;br /&gt;
|group=dev-apps-js-debugger&lt;br /&gt;
|source_dirs=js/jsd/&lt;br /&gt;
|url=http://www.mozilla.org/js/jsd&lt;br /&gt;
|components=Other Applications::Venkman JS Debugger&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=jsat&lt;br /&gt;
|description=Javascript screen reader that is used in Android and B2G&lt;br /&gt;
|owner=[mailto:eitan@monotonous.org Eitan Isaacson]&lt;br /&gt;
|peers=[mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/jsat/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-ctypes&lt;br /&gt;
|description=A foreign function interface which allows privileged JS code to interact with binary code without using XPCOM/XPConnect.&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src/ctypes/&lt;br /&gt;
|url=https://wiki.mozilla.org/JSctypes&lt;br /&gt;
|components=Core::js-ctypes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-tests&lt;br /&gt;
|description=JavaScript test suite&lt;br /&gt;
|owner=[mailto:bclary@bclary.com Bob Clary]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tests/&lt;br /&gt;
|url=http://www.mozilla.org/js/tests/library.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Layout Engine&lt;br /&gt;
|description=rendering tree construction, layout (reflow), etc.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:bzbarsky@mit.edu Boris Zbarsky],  [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:jfkthame@gmail.com Jonathan Kew], [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:matt.woodrow@gmail.com Matt Woodrow], [mailto:xidorn+moz@upsuper.org Xidorn Quan]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/%, layout/base/, layout/build/, layout/doc/, layout/forms/, layout/generic/, layout/html/, layout/printing/, layout/tables/, layout/tools/&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout, Core::Layout: Block and Inline, Core::Layout: Floats, Core::Layout: Form Controls, Core::Layout: HTML Frames, Core::Layout: Images, Core::Layout: Misc Code, Core::Layout: R &amp;amp; A Pos, Core::Layout: Tables, Core::Layout: Text, Core::Print Preview, Core::Printing: Output&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=libjar&lt;br /&gt;
|description=The JAR handling code (protocol handler, stream implementation, and zipreader/zipwriter).&lt;br /&gt;
|owner=[mailto:mwu@mozilla.com Michael Wu]&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libjar&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MathML&lt;br /&gt;
|description=MathML is a low-level specification for describing mathematics which provides a foundation for the inclusion of mathematical expressions in Web pages.&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-tech-mathml&lt;br /&gt;
|source_dirs=layout/mathml/&lt;br /&gt;
|url=http://www.mozilla.org/projects/mathml/&lt;br /&gt;
|components=Core::MathML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Playback&lt;br /&gt;
|description=HTML Media APIs, including Media Source Extensions and non-MSE video/audio element playback, and Encrypted Media Extensions. (WebRTC and WebAudio not included).&lt;br /&gt;
|owner=[mailto:jyavenard@mozilla.com Jean-Yves Avenard]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:cpearce@mozilla.com Chris Pearce]&lt;br /&gt;
|peers=[mailto:kinetik@flim.org Matthew Gregan], [mailto:bvandyk@mozilla.com Bryce Van Dyk], [mailto:jolin@mozilla.com John Lin], [mailto:alwu@mozilla.com Alastor Wu], [mailto:jwwang@mozilla.com JW Wang]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=dom/media, media/gmp-clearkey/, media/libcubeb/, media/libnestegg/, media/libogg/, media/libopus/, media/libstagefright/, media/libtheora/, media/libtremor/, media/libvorbis/, media/libvpx/, media/omx-plugin/, media/rlz/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Audio/Video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Transport&lt;br /&gt;
|description=Pluggable transport for real-time media&lt;br /&gt;
|owner=[mailto:ekr@rtfm.com Eric Rescorla]&lt;br /&gt;
|peers=[mailto:bcampen@mozilla.com Byron Campen], [mailto:abr@mozilla.com Adam Roach], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=media/mtransport&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::WebRTC::Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Memory Allocator&lt;br /&gt;
|description=Most things related to memory allocation in Gecko, including jemalloc, replace-malloc, DMD (dark matter detector), logalloc, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:n.nethercote@gmail.com Nicholas Nethercote], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=memory/&lt;br /&gt;
|components=Core::DMD, Core::jemalloc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mfbt&lt;br /&gt;
|description=mfbt is a collection of headers, macros, data structures, methods, and other functionality available for use and reuse throughout all Mozilla code (including SpiderMonkey and Gecko more broadly).&lt;br /&gt;
|owner=[mailto:jwalden@mit.edu Jeff Walden]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:Ms2ger@gmail.com Ms2ger], [mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mfbt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::MFBT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Mozglue&lt;br /&gt;
|description=Glue library containing various low-level functionality, including a dynamic linker for Android, a DLL block list for Windows, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd] (mozglue/linker), [mailto:kgupta@mozilla.com Kartikaya Gupta] (mozglue/android), [mailto:nchen@mozilla.com Jim Chen] (mozglue/android), [mailto:aklotz@mozilla.com Aaron Klotz] (Windows Dll Blocklist/Interceptor)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mozglue/&lt;br /&gt;
|components=Core::mozglue&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozilla-toplevel&lt;br /&gt;
|description=The top level directory for the mozilla tree.&lt;br /&gt;
|owner=[[Modules/Firefox_Technical_Leadership|Firefox Technical Leadership module]]&lt;br /&gt;
|ownersemeritus=[mailto:brendan@mozilla.org Brendan Eich]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=tools/README&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MSCOM&lt;br /&gt;
|description=Integration with Microsoft Distributed COM&lt;br /&gt;
|owner=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|peers=[mailto:jteh@mozilla.com James Teh], [mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/mscom/%&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC: MSCOM}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Necko&lt;br /&gt;
|description=The Mozilla Networking Library&lt;br /&gt;
|owner=[mailto:dd.mozilla@gmail.com  Dragana Damjanovic]&lt;br /&gt;
|peers= [mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:mnovotny@mozilla.com Michal Novotny], [mailto:hurley@mozilla.com Nick Hurley], [mailto:dd.mozilla@gmail.com  Dragana Damjanovic ], [mailto:valentin.gosu@gmail.com Valentin Gosu], [mailto:daniel@haxx.se Daniel Stenberg ], [mailto:jduell.mcbugs@gmail.com Jason Duell] &lt;br /&gt;
|ownersemeritus=[mailto:mcmanus@ducksong.com Patrick McManus], [mailto:cbiesinger@gmail.com Christian Biesinger] |peersemeritus= Shih-Chiang Chien, [mailto:bzbarsky@mit.edu Boris Zbarsky], Steve Workman &lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=netwerk/%, netwerk/base/, netwerk/build/, netwerk/cache/, netwerk/dns/, netwerk/locales/, netwerk/mime/, netwerk/protocol/, netwerk/resources/, netwerk/socket/, netwerk/streamconv/, netwerk/system/, netwerk/test/, netwerk/testserver/&lt;br /&gt;
|url=http://www.mozilla.org/projects/netlib/, https://developer.mozilla.org/en/Necko&lt;br /&gt;
|components=Core::Networking, Core::Networking: Cache, Core::Networking: Cookies, Core::Networking: FTP, Core::Networking: File, Core::Networking: HTTP, Core::Networking: JAR, Core::Networking: Websockets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=NSPR&lt;br /&gt;
|description=Netscape Portable Runtime&lt;br /&gt;
|owner=[mailto:kaie@kuix.de Kai Engert]&lt;br /&gt;
|peers=[mailto:wtc@google.com Wan-Teh Chang], [mailto:mh@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-tech-nspr&lt;br /&gt;
|source_dirs=nsprpub/&lt;br /&gt;
|url=http://www.mozilla.org/projects/nspr/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/reference/html/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/release-notes/&lt;br /&gt;
|components=NSPR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PDF&lt;br /&gt;
|description=Rendering code to display documents encoded in the ISO 32000-1 `PDF&#039; format.&lt;br /&gt;
|owner=Chris Jones, Andreas Gal&lt;br /&gt;
|peers=[mailto:aadib@mozilla.com Artur Adib], [mailto:bdahl@mozilla.com Brendan Dahl], [mailto:vnicolas@mozilla.com Vivien Nicolas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/pdf/&lt;br /&gt;
|url=https://github.com/mozilla/pdf.js&lt;br /&gt;
|components=Core::PDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Plugins&lt;br /&gt;
|description= NPAPI Plugin support.&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:john@pointysoftware.net John Schoenick], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:jstenback@gmail.com Johnny Stenback], Benjamin Smedberg&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/plugins/, modules/plugin/&lt;br /&gt;
|url=https://wiki.mozilla.org/Plugins&lt;br /&gt;
|components=Core::Plug-ins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Preferences&lt;br /&gt;
|description=Preference library&lt;br /&gt;
|owner=[mailto:nnethercote@mozilla.com Nicholas Nethercote]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:felipe@mozilla.com Felipe Gomes], [mailto:glandium@mozilla.com Mike Hommey], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libpref/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Preferences: Backend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Private Browsing&lt;br /&gt;
|description=Implementation of the Private Browsing mode, and the integration of other modules with Private Browsing APIs.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=Implementation and consumers of Private Browsing APIs in nsILoadContext, nsIPrivateBrowsingChannel, PrivateBrowsingUtils.jsm and the related glue code. &lt;br /&gt;
|url=https://wiki.mozilla.org/Private_Browsing&lt;br /&gt;
|components=Firefox::Private Browsing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Privilege Manager&lt;br /&gt;
|description=&amp;quot;caps&amp;quot;&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peersemeritus=[mailto:brendan@mozilla.org Brendan Eich], [mailto:jstenback@gmail.com Johnny Stenback], [mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=caps/&lt;br /&gt;
|url=http://www.mozilla.org/projects/security/components/index.html&lt;br /&gt;
|components=Core::Security: CAPS&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Push Notifications&lt;br /&gt;
|description=Push is a way for application developers to send messages to their web applications.&lt;br /&gt;
|owners=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:lina@mozilla.com Lina Cambridge], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ddamjanovic@mozilla.com Dragana Damjanovic]&lt;br /&gt;
|peersemeritus=[mailto:nsm.nikhil@gmail.com Nikhil Marathe]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/push&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM: Push Notifications&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PyXPCOM&lt;br /&gt;
|description=The Python to XPCOM bridge.&lt;br /&gt;
|owner=Todd Whiteman&lt;br /&gt;
|peers=[mailto:mhammond@skippinet.com.au Mark Hammond]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=extension/python&lt;br /&gt;
|url=https://developer.mozilla.org/en/PyXPCOM&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=RDF&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:axel@pike.org Axel Hecht]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-rdf&lt;br /&gt;
|source_dirs=rdf/&lt;br /&gt;
|url=http://www.mozilla.org/rdf/doc/&lt;br /&gt;
|components=Core::RDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=security&lt;br /&gt;
|description=Crypto/PKI code, including NSS (Network Security Services) and JSS (NSS for Java)&lt;br /&gt;
|owner=[mailto:rrelyea@redhat.com Bob Relyea], [mailto:martin.thomson@gmail.com Martin Thomson]&lt;br /&gt;
|ownersemeritus=[mailto:ttaubert@mozilla.com Tim Taubert]&lt;br /&gt;
|peers=[mailto:kaie@kuix.de Kai Engert], [mailto:ryan.sleevi@gmail.com Ryan Sleevi], [mailto:ekr@rtfm.com Eric Rescorla], [mailto:franziskuskiefer@gmail.com Franziskus Kiefer], [mailto:wtc@google.com Wan-Teh Chang], [mailto:dueno@redhat.com Daiki Ueno]&lt;br /&gt;
|peersemeritus=[mailto:emaldona@redhat.com Elio Maldonado]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=dbm/, security/coreconf/, security/dbm/, security/jss/, security/nss/, security/tinderbox/, security/tinderlight/&lt;br /&gt;
|url=http://mozilla.org/projects/security/pki/&lt;br /&gt;
|components=NSS, JSS, Core::Security, Core::Security: S/MIME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Security - Mozilla PSM Glue&lt;br /&gt;
|description=Personal Security Manager&lt;br /&gt;
|owner=[mailto:dkeeler@mozilla.com Dana Keeler]&lt;br /&gt;
|ownersemeritus=[mailto:kaie@kuix.de Kai Engert (2001-2012)]&lt;br /&gt;
|peers=[mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:cykesiopka.bmo@gmail.com Cykesiopka], [mailto:jc@mozilla.com J.C. Jones], [mailto:fkiefer@mozilla.com Franziskus Kiefer]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=security/manager/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Security: PSM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Static analysis &amp;amp; rewriting for C++&lt;br /&gt;
|description=Tools for checking C++ code looking for problems at compile time, plus tools for automated rewriting of C++ code.&lt;br /&gt;
|owner=[mailto:nika@thelayzells.com Nika Layzell] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:sfink@mozilla.com Steve Fink], [mailto:jrmuizel@mozilla.com Jeff Muizelaar], [mailto:birunthan@mohanathas.com Birunthan Mohanathas], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:andi@mozilla.com Andi-Bogdan Postelnicu]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=build/clang-plugin, tools/rewriting among other out of tree tools&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Rewriting &amp;amp; Analysis&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=storage&lt;br /&gt;
|description=Storage APIs with a SQLite backend&lt;br /&gt;
|owner=[mailto:mak77@bonardo.net Marco Bonardo]&lt;br /&gt;
|peers=[mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=db/sqlite3/, storage/&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/Storage&lt;br /&gt;
|components=Toolkit::Storage, Core::SQL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=String&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=string/, xpcom/string/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Mozilla_internal_string_guide&lt;br /&gt;
|components=Core::String&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Style System&lt;br /&gt;
|description=CSS style sheet handling; style data computation&lt;br /&gt;
|owner= [mailto:cam@mcc.id.au Cameron McCormack]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:emilio@crisal.io Emilio Cobos Álvarez], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:xidorn+moz@upsuper.org Xidorn Quan], [mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/style/&lt;br /&gt;
|url=https://wiki.mozilla.org/Gecko:Overview#Style_System&lt;br /&gt;
|components=Core::CSS Parsing and Computation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=SVG&lt;br /&gt;
|description=Scalable Vector Graphics&lt;br /&gt;
|owner=[mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|peers=[mailto:longsonr@gmail.com Robert Longson], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:birtles@gmail.com Brian Birtles]&lt;br /&gt;
|group=dev-tech-svg&lt;br /&gt;
|source_dirs=dom/svg/, layout/svg/, dom/smil/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Web/SVG&lt;br /&gt;
|components=Core::SVG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Tamarin&lt;br /&gt;
|description=VM for ActionScript and JavaScript&lt;br /&gt;
|owner=Edwin Smith, [mailto:jodyer@adobe.com Jeff Dyer]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:stejohns@adobe.com Steven Johnson], [mailto:tierney@adobe.com Erik Tierney], [mailto:treilly@adobe.com Tom Reilly]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tamarin&lt;br /&gt;
|url=http://www.mozilla.org/projects/tamarin/&lt;br /&gt;
http://wiki.mozilla.org/tamarin/&lt;br /&gt;
http://hg.mozilla.org/tamarin-central/&lt;br /&gt;
http://hg.mozilla.org/tamarin-tracing/&lt;br /&gt;
|components=Tamarin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Test Harness&lt;br /&gt;
|description=In-tree test infrastructure and tools. Harnesses include, XPCShell, Mochitest (&amp;amp; Chrome), Reftest, JsREftest, Compiled Code Tests, Robocop, Mozmill, Marionette, Firefox UI Tests. Requests for new harnesses should go to Testing::General.&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron] (reftest), [mailto:jwalden@mit.edu Jeff Walden] (httpd.js, jsreftest), Rob Campbell (mochitest, mochitest chrome, marionette), [mailto:jmaher@mozilla.com Joel Maher] (reftest, mochitest, jsreftest), [mailto:ctalbert@mozilla.com Clint Talbert] (reftest, compiled code, mozmill), [mailto:geoffbrown@mozilla.com Geoff Brown] (robocop), [mailto:hskupin@mozilla.com Henrik Skupin] (Marionette, Firefox UI tests), [mailto:ato@mozilla.com Andreas Tolfsen] (marionette), [mailto:jgriffin Jonathan Griffin] (marionette), [mailto:dburns@mozilla.com David Burns] (marionette), [mailto:dminor@mozilla.com Dan Minor], [mailto:mjzffr@gmail.com Maja Frydrychowicz] (Marionette, Firefox UI tests), [mailto:james@hoppipolla.co.uk James Graham],&lt;br /&gt;
&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=/testing&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::General, Testing::Mochitest, Testing::Mochitest Chrome, Testing::Marionette, Testing::Mozmill, Testing::Reftest, Testing::XPCShell Harness, Testing::httpd.js&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Testing Infrastructure&lt;br /&gt;
|description=Testing tools and infrastructure for Mozilla projects, harnesses for automated tests, stand-alone test tools. Talos, Graph Server, Mozbase, Pulse, WOO, Bughunter, SUTAgent, Eideticker&lt;br /&gt;
|owner=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|peers=[mailto:bclary@bclary.com Bob Clary], [mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:ccooper@deadsquid.com Chris Cooper], [mailto:ctalbert@mozilla.com Clint Talbert], [mailto:robert@roberthelmer.com Robert Helmer], [mailto:jmaher@mozilla.com Joel Maher], Rob Campbell, [mailto:wlach@mozilla.com William Lachance], [mailto:jeads@mozilla.com Jonathan Eads], [mailto:jgriffin Jonathan Griffin], [mailto:bmoss@mozilla.com Bob Moss], [mailto:mcote@mozilla.com Mark Côté]&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=testing/, tools/httptester/, tools/page-loader/, tools/test-harness/, tools/tests/, tools/testserver/, tools/testy/&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::Infrastructure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JS Marionette&lt;br /&gt;
|description=NodeJS test harness, marionette client, and other utilities for running marionette tests (submodule of Test Infrastructure)&lt;br /&gt;
|owner=[mailto:jlal@mozilla.com James Lal] &amp;lt;lightsofapollo&amp;gt;, [mailto:gaye@mozilla.com Gareth Aye] &amp;lt;gaye&amp;gt;&lt;br /&gt;
|peers=[mailto:aus@mozilla.com Ghislain &amp;quot;Aus&amp;quot; Lacroix] &amp;lt;auswerk&amp;gt;&lt;br /&gt;
|source_dirs=gaia/tests/jsmarionette&lt;br /&gt;
|components=Testing::JSMarionette&lt;br /&gt;
|group=dev-gaia&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCShell Test Harness&lt;br /&gt;
|description=The XPCShell Harness&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|source_dirs=testing/xpcshell&lt;br /&gt;
|components=Testing::XPCShell Harness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Update Service&lt;br /&gt;
|description=server code for Mozilla Update services (aus, addons, pfs)&lt;br /&gt;
|owner=Mike Morgan&lt;br /&gt;
|peers=[mailto:jscott@mozilla.com Justin Scott], [mailto:shaver@mozilla.org Mike Shaver], [mailto:wclouser@mozilla.com Will Clouser]&lt;br /&gt;
|group=dev-amo&lt;br /&gt;
|source_dirs=webtools/addons/, webtools/aus/, webtools/update/&lt;br /&gt;
|url=http://wiki.mozilla.org/wiki/AMO&lt;br /&gt;
|components=AUS::Administration, AUS::Systems&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=View System&lt;br /&gt;
|description=The View Manager is responsible for handling &amp;quot;heavyweight&amp;quot; rendering (some clipping, compositing) and event handling tasks.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=view/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Layout: View Rendering&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Audio&lt;br /&gt;
|description=Support for the W3C Web Audio API specification.&lt;br /&gt;
|owner=[mailto:padenot@mozilla.com Paul Adenot]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/media/webaudio&lt;br /&gt;
|url=https://wiki.mozilla.org/Web_Audio_API&lt;br /&gt;
|components=Core::Web Audio&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Painting&lt;br /&gt;
|description=painting, display lists, and layer construction&lt;br /&gt;
|owner=[mailto:matt.woodrow@gmail.com Matt Woodrow]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dbaron@dbaron.org David Baron],   [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:mstange@themasta.com Markus Stange], [mailto:mmynttinen@mozilla.com Miko Mynttinen], [mailto:jnicol@mozilla.com Jamie Nicol]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs= layout/painting, the display list and layer related methods on nsIFrame and its subclasses&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout: Web Painting&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC&lt;br /&gt;
|description=WebRTC is responsible for realtime audio and video communication, as well as related issues like low-level camera and microphone access&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:bcampen@mozilla.com Byron Campen] [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=netwerk/sctp (also see submodules &amp;quot;WebRTC Media&amp;quot; and &amp;quot;WebRTC Signaling&amp;quot;)&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC, Core::WebRTC Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebVR&lt;br /&gt;
|description=Gecko&#039;s implementation of WebVR (Virtual Reality) functionality, including API, devices, graphics and integration&lt;br /&gt;
|owner=[mailto:kgilbert@mozilla.com Kip Gilbert]&lt;br /&gt;
|peers=[mailto:dmu@mozilla.com Daosheng Mu]&lt;br /&gt;
|peersemeritus=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/vr, gfx/vr&lt;br /&gt;
|url=https://mozvr.com/&lt;br /&gt;
|components=Core::WebVR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peersemeritus=[mailto:pavlov@pavlov.net Stuart Parmenter], &lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/, widget/xpwidgets/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Drag and Drop, Core::Widget, Core::Printing: Setup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Android&lt;br /&gt;
|description=The Android Port&lt;br /&gt;
|owner=[mailto:blassey.bugs@lassey.us Brad Lassey]&lt;br /&gt;
|peers=[mailto:jwillcox@mozilla.com James Willcox]&lt;br /&gt;
|group=dev-platforms-mobile&lt;br /&gt;
|source_dirs=widget/android/, embedding/android&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Android&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - GTK&lt;br /&gt;
|description=supported X widgetry and gfx&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/gtk/, widget/gtk2/, widget/gtksuperwin/, widget/gtkxtbin/&lt;br /&gt;
|url=http://www.mozilla.org/unix/, http://www.gtk.org, http://www.mozilla.org/ports/gtk/&lt;br /&gt;
|components=Core::Widget: Gtk&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - OS X&lt;br /&gt;
|description= Gecko&#039;s OS X compatibility layer.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:spohl@mozilla.com Stephen Pohl], [mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:b56girard@gmail.com Benoit Girard], [mailto:smichaud@pobox.com Steven Michaud]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/cocoa/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Cocoa&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Windows&lt;br /&gt;
|description=Windows widgets and desktop integration&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peersemeritus=[mailto:blassey@mozilla.com Brad Lassey], [mailto:netzen@gmail.com Brian Bondy], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:doug.turner@gmail.com Doug Turner], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref], [mailto:robarnold@cmu.edu Rob Arnold]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/windows/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Win32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XBL&lt;br /&gt;
|description=eXtensible Binding Language&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|ownersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=dom/xbl/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xbl/&lt;br /&gt;
|components=Core::XBL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XML&lt;br /&gt;
|description=XML in Mozilla, including XML, XHTML, Namespaces in XML, Associating Style Sheets with XML Documents, XML Linking and XML Extras. XML-related things that are not covered by more specific projects.&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-tech-xml&lt;br /&gt;
|source_dirs=dom/xml/, extensions/xmlextras/, parser/expat/&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/xml/&lt;br /&gt;
|components=Core::XML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPApps&lt;br /&gt;
|description=Cross-Platform Applications, mostly Navigator front end and application shell.&lt;br /&gt;
|owner=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|peers=[mailto:dean_tessman@hotmail.com Dean Tessman], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-apps-seamonkey&lt;br /&gt;
|source_dirs=xpfe/&lt;br /&gt;
|url=http://www.mozilla.org/xpapps/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCOM&lt;br /&gt;
|description=The cross-platform object model and core data structures.&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd]&lt;br /&gt;
|peers=[mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|ownersemeritus=Benjamin Smedberg&lt;br /&gt;
|peersemeritus=[https://mozillians.org/en-US/u/dougt/ Doug Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=startupcache/, xpcom/%, xpcom/base/, xpcom/build/, xpcom/components/, xpcom/ds/, xpcom/glue/, xpcom/proxy/, xpcom/sample/, xpcom/stub/, xpcom/tests/, xpcom/threads/, xpcom/tools/, xpcom/windbgdlg/&lt;br /&gt;
|url=http://developer.mozilla.org/en/XPCOM&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPConnect&lt;br /&gt;
|description=Deep Magic&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:amccreight@mozilla.com Andrew McCreight], [mailto:kmaglione@mozilla.com Kris Maglione], [mailto:nika@thelayzells.com Nika Layzell]&lt;br /&gt;
|peersemeritus=[mailto:gal@uci.edu Andreas Gal], [mailto:jstenback@gmail.com Johnny Stenback], [mailto:gkrizsanits@mozilla.com Gabor Krizsanits]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=js/xpconnect/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::XPConnect&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPIDL&lt;br /&gt;
|description=Cross-platform IDL compiler; produces .h C++ header files and .xpt runtime type description files from .idl interface description files.&lt;br /&gt;
|owner=[mailto:nika@thelayzells.com Nika Layzell]&lt;br /&gt;
|peers=[mailto:nfroyd@mozilla.com Nathan Froyd], [mailto:amccreight@mozilla.com Andrew McCreight]&lt;br /&gt;
|ownersemeritus=[mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|peersemeritus=[mailto:shaver@mozilla.org Mike Shaver], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=xpcom/typelib/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xpidl&lt;br /&gt;
http://www.mozilla.org/scriptable&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPToolkit&lt;br /&gt;
|description=Cross-platform user interface toolkit&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Jan.Varga@gmail.com Jan Varga]&lt;br /&gt;
|group=dev-tech-xul&lt;br /&gt;
|source_dirs=dom/xul/, layout/xul/&lt;br /&gt;
|url=http://www.mozilla.org/xpfe/&lt;br /&gt;
|components=Core::XP Toolkit/Widgets: Menus, Core::XP Toolkit/Widgets: XUL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XSLT Processor&lt;br /&gt;
|description=XSLT transformations processor&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:axel@pike.org Axel Hecht], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xslt&lt;br /&gt;
|source_dirs=dom/xslt/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xslt/, http://www.w3.org/TR/xslt.html&lt;br /&gt;
|components=Core::XSLT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Windows &lt;br /&gt;
|description=Sandboxing for the Windows platform &lt;br /&gt;
|owner=[mailto:bobowencode@gmail.com Bob Owen] (:bobowen)&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz] (:aklotz), [mailto:jimm@mozilla.com Jim Mathies] (:jimm), [mailto:davidp99@gmail.com David Parks] (:handyman)&lt;br /&gt;
|ownersemeritus=[https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes]&lt;br /&gt;
|peersemeritus=[mailto:netzen@gmail.com Brian Bondy]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/win &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - OSX &lt;br /&gt;
|description=Sandboxing for the OSX platform &lt;br /&gt;
|owner=[mailto:haftandilian@mozilla.com Haik Aftandilian]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox/mac &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Linux&lt;br /&gt;
|description=Sandboxing for the Linux platform&lt;br /&gt;
|owner=[mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|peers=[mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/linux&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Submodules===&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Fennec&lt;br /&gt;
|description=Submodule of the build config covering Fennec&#039;s build system in mobile/android.&lt;br /&gt;
|owner=[mailto:nalexander@mozilla.com Nicholas Alexander]&lt;br /&gt;
|peers=Same as Build Config&lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Taskgraph&lt;br /&gt;
|description=Support for task-graph generation in decision, action, and cron tasks, including configuration of all tasks including those for CI, nightlies, and releases; as well as Docker and VM images used to execute those tasks.&lt;br /&gt;
|owner=[mailto:dustin@mozilla.com Dustin Mitchell]&lt;br /&gt;
|peers=[mailto:ahal@mozilla.com Andrew Halberstadt], [mailto:aki@mozilla.com Aki Sasaki], [mailto:bstack@mozilla.com Brian Stack], [mailto:mh@glandium.org Mike Hommey], [mailto:gps@mozilla.com Gregory Szorc], [mailto:jmaher@mozilla.com Joel Maher], [mailto:callek@mozilla.com Justin Wood], [mailto:mozilla@hocat.ca Tom Prince]&lt;br /&gt;
|components=Firefox Build System::Task Configuration&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Media&lt;br /&gt;
|description=Submodule of WebRTC responsible for access to media input devices (microphones, cameras, screen capture), as well as realtime audiovisual codecs and packetization.&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:jib@mozilla.com Jan-Ivar Bruaroey], [mailto:dminor@mozilla.com Dan Minor], [mailto:apehrson@mozilla.com Andreas Pehrson], &lt;br /&gt;
|peersemeritus=[mailto:pkerr@mozilla.com Paul Kerr], [mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc, /dom/media/webrtc, /dom/media/systemservices&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Audio/Video)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Signaling&lt;br /&gt;
|description=Submodule of WebRTC responsible for implementation of PeerConnection API, WebRTC identity, and SDP/JSEP handling&lt;br /&gt;
|owner=[mailto:bcampen@mozilla.com Byron Campen]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:abr@mozilla.com Adam Roach], [mailto:rjesup@mozilla.com Randell Jesup], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc/signaling/&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Signaling)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unassigned Bugzilla Components===&lt;br /&gt;
&lt;br /&gt;
The following Bugzilla components in the Core project have not been assigned to a module (this list is not exhaustive):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Core::Find Backend&lt;br /&gt;
Core::General&lt;br /&gt;
Core::HTML: Form Submission&lt;br /&gt;
Core::History: Global&lt;br /&gt;
Core::Image Blocking&lt;br /&gt;
Core::Localization&lt;br /&gt;
Core::Networking: Domain Lists&lt;br /&gt;
Core::Selection&lt;br /&gt;
Core::Serializers&lt;br /&gt;
Core::Spelling checker&lt;br /&gt;
Core::X-remote&lt;br /&gt;
Core::XUL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/Awesome_Fetch_API&amp;diff=1190882</id>
		<title>Accessibility/Awesome Fetch API</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/Awesome_Fetch_API&amp;diff=1190882"/>
		<updated>2018-03-21T21:42:58Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: Created page with &amp;quot;=Awesome Fetch API=  ==Summary==  A bulk data fetching API is designed to * to search the data through a web page * to retrieve portions of a web page in a single call  which...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Awesome Fetch API=&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
A bulk data fetching API is designed to&lt;br /&gt;
* to search the data through a web page&lt;br /&gt;
* to retrieve portions of a web page in a single call&lt;br /&gt;
&lt;br /&gt;
which allows to&lt;br /&gt;
* decrease number of calls the AT has to poke into a server&lt;br /&gt;
* create buffer-less screen readers&lt;br /&gt;
* create lazy and lightweight server implementations&lt;br /&gt;
&lt;br /&gt;
A typical scenarios are&lt;br /&gt;
* Navigation: AT fetches next/prev heading while the user moves through a web page&lt;br /&gt;
* Read a range: AT reads a paragraph by lines&lt;br /&gt;
&lt;br /&gt;
==Terms and concepts==&lt;br /&gt;
&lt;br /&gt;
Terms:&lt;br /&gt;
* Search filters which allows to narrow the data that AT is interested in, for example, find all accessible having a heading role&lt;br /&gt;
* Result specifiers which allows to specify what kind of data should be fetched, for example, AT is interested to retrieve accessible names and boundaries&lt;br /&gt;
* AOM points (accessible object model aka DOM) which are used to identify and compare ranges in a document. Inspired by DOM point concept.&lt;br /&gt;
&lt;br /&gt;
Also it operates with AT concepts, which are:&lt;br /&gt;
* &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; - a primary characteristic of object like &amp;lt;code&amp;gt;button&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;states&amp;lt;/code&amp;gt; - boolean characteristics of object like &amp;lt;code&amp;gt;focused&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;selected&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; - a named property having a scalar value (not boolean), for example &amp;lt;code&amp;gt;level:1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;relations&amp;lt;/code&amp;gt; - a named property pointing to other object such as &amp;lt;code&amp;gt;label_for&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;boundaries&amp;lt;/code&amp;gt; - an object boundary in form of a rect&lt;br /&gt;
* &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; - text&lt;br /&gt;
&lt;br /&gt;
==Proposal==&lt;br /&gt;
&lt;br /&gt;
===Search===&lt;br /&gt;
&lt;br /&gt;
====Search filters====&lt;br /&gt;
&lt;br /&gt;
Filter is a boolean expression consisting of conditions combined by boolean operators like: &amp;lt;code&amp;gt;cond1 &amp;amp;&amp;amp; cond2 || cond3&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;condN&amp;lt;/code&amp;gt; is a boolean function which returns true for each accessible object complying a function&#039;s criteria.&lt;br /&gt;
&lt;br /&gt;
Suggested boolean functions:&lt;br /&gt;
* &amp;lt;code&amp;gt;is(trait)&amp;lt;/code&amp;gt; - returns true if an accessible object has a given trait which may be role or state. For example &amp;lt;code&amp;gt;is(listitem) &amp;amp;&amp;amp; is(selected)&amp;lt;/code&amp;gt; indicates all selected list items.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;has(property[, value])&amp;lt;/code&amp;gt; - return true for an accessible object having a property of a value if provided, for example, &amp;lt;code&amp;gt;has(level, 5)&amp;lt;/code&amp;gt; stands for all objects having level attribute with value of 5.&lt;br /&gt;
&lt;br /&gt;
A value of &amp;lt;code&amp;gt;has&amp;lt;/code&amp;gt; method is not necessary a scalar value. If a property points to an object, then a boolean function can be used as a value. For example, &amp;lt;code&amp;gt;has(controls, is(listbox))&amp;lt;/code&amp;gt; will return an object which controls a listbox object.&lt;br /&gt;
&lt;br /&gt;
====Search/Query API====&lt;br /&gt;
&lt;br /&gt;
Search/query is a way to find points or a range complying a search criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
query(AOMPoint anchor, String direction, String searchTerm, AOMPoint start, AOMPoint end)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to return a a first AOM point complying a search term.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
queryAll(AOMPoint anchor, String direction, String searchTerm, AOMPoint start, AOMPoint end)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to return a list of all entries complying a search term.&lt;br /&gt;
&lt;br /&gt;
===Data fetching===&lt;br /&gt;
&lt;br /&gt;
====Result specifiers====&lt;br /&gt;
&lt;br /&gt;
Results specifiers are used to scope fetched data. The format is &amp;lt;code&amp;gt;property:value,[value,...]&amp;lt;/code&amp;gt;. For example &amp;lt;code&amp;gt;role;states;attributes:level,xml-roles&amp;lt;/code&amp;gt; will return role, states, level and xml-roles attribute.&lt;br /&gt;
&lt;br /&gt;
====Data format====&lt;br /&gt;
&lt;br /&gt;
The fetching data is supposed to be in JSON format. For example,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[{&lt;br /&gt;
  role: &amp;quot;heading&amp;quot;,&lt;br /&gt;
  states: [&lt;br /&gt;
    &amp;quot;invisible&amp;quot;, &amp;quot;offscreen&amp;quot;&lt;br /&gt;
  ],&lt;br /&gt;
  attributes: {&lt;br /&gt;
    xml-roles: [ &amp;quot;super-button&amp;quot;, &amp;quot;lower-button&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  boundaries: [ x, y, width, height ],&lt;br /&gt;
  text: [&lt;br /&gt;
  ]&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
  role: &amp;quot;heading&amp;quot;,&lt;br /&gt;
  states: [&lt;br /&gt;
    &amp;quot;visible&amp;quot;, &amp;quot;onscreen&amp;quot;&lt;br /&gt;
  ],&lt;br /&gt;
  attributes: {&lt;br /&gt;
    level: 1&lt;br /&gt;
  },&lt;br /&gt;
  boundaries: [ x, y, width, height ]&lt;br /&gt;
}]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====API====&lt;br /&gt;
&lt;br /&gt;
So used to fetch all &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
fetch(in AOMPoint start, in AOMPoint end, out String serializedRange)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns a string of data of the above format.&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Community:SummerOfCode18&amp;diff=1189030</id>
		<title>Community:SummerOfCode18</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Community:SummerOfCode18&amp;diff=1189030"/>
		<updated>2018-02-14T23:06:29Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* 2018 Project List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is Mozilla&#039;s list of green-lit project proposals for the 2018 Google Summer of Code. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Are you a student looking to apply to GSoC with Mozilla?&amp;lt;/b&amp;gt; You&#039;re in the right place. This page lists all the confirmed [[SummerOfCode|Google Summer of Code]] projects. New suggestions can be made on [[Community:SummerOfCode18:Brainstorming|the Brainstorming page]]. Do not edit this page yourself; contact Mike Hoye or Florian for edits.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re interested in participating in Mozilla&#039;s GSoC program, you can choose from the list below, &#039;&#039;&#039;but you do not have to&#039;&#039;&#039;. You can submit a proposal for your own idea. You should look at the [[Community:SummerOfCode18:Brainstorming|guidelines]], though, and discuss your ideas or application in the #introduction channel on IRC.Mozilla.org. This is important, as GSoC projects &#039;&#039;&#039;must have&#039;&#039;&#039; a supporting member of the Mozilla community to evaluate and mentor them, named in the application.&lt;br /&gt;
&lt;br /&gt;
===Application Advice===&lt;br /&gt;
&lt;br /&gt;
You should do the following:&lt;br /&gt;
&lt;br /&gt;
* Talk to the mentor. Contact details are on this page; if all you have is a nickname, reach out to them on IRC.&lt;br /&gt;
* Read the [https://flossmanuals.net/GSoCStudentGuide/ GSoC Student Guide] and follow its advice.&lt;br /&gt;
* Read [http://blog.gerv.net/2006/05/how_not_to_apply_for_summer_of/ How Not To Apply For Summer Of Code] and avoid doing the things listed there.&lt;br /&gt;
* Read our examples of good applications: [[SummerOfCode/SampleApplications/1|1]], [[SummerOfCode/SampleApplications/2|2]], [[SummerOfCode/SampleApplications/3|3]].&lt;br /&gt;
* Apply on [https://summerofcode.withgoogle.com/ the GSoC site] (note that we have an [[SummerOfCode/ApplicationTemplate|application template]]).&lt;br /&gt;
* It is entirely acceptable to apply for 2 or 3 projects, if more than one catches your eye; if the applications are high quality, that can improve your chances. Applying to more than that will seem like spam.&lt;br /&gt;
&lt;br /&gt;
Questions about individual projects are best addressed to the potential mentor of that project. These should be listed in the table below. If you want to contact a mentor and contact details are not here, ask people in the #introduction channel on IRC: irc://irc.mozilla.org/#introduction. If you have questions of any other sort, send mail to [mailto:mhoye@mozilla.com Mike Hoye]. He will try and respond promptly and direct your questions to the right person.  &lt;br /&gt;
&lt;br /&gt;
===Project List===&lt;br /&gt;
&lt;br /&gt;
* The following projects have been tentatively greenlit, pending milestone clarifications.&lt;br /&gt;
&lt;br /&gt;
== 2018 Project List ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;standard-table&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border-collapse: collapse&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Title &lt;br /&gt;
! Details &lt;br /&gt;
! Skills Needed &lt;br /&gt;
! Reporter &lt;br /&gt;
! Mentor(s) &lt;br /&gt;
! Additional Comments&lt;br /&gt;
|-&lt;br /&gt;
| ReSpec &lt;br /&gt;
| [https://github.com/w3c/respec/ ReSpec] is a JS-based tool used to write W3C Specifications (Web Standards) that is widely used by the Web Standards Community. With 5+ years of development, it&#039;s heavily depended upon by the W3C community at large (of which Mozilla is an active participant). ReSpec&#039;s code is in need of some modernization, optimizations, and bug fixes - and we could use your help! In this project, you would have the opportunity to make ReSpec&#039;s UI more accessible, making it leaner and faster using distributed processing with Web Workers, and/or adding new features to make the lives of W3C spec Editor&#039;s better. &lt;br /&gt;
| Languages or skills needed: JavaScript, HTML, CSS. &lt;br /&gt;
| [https://mozillians.org/en-US/u/mcaceres/ Marcos Caceres]&lt;br /&gt;
| [https://mozillians.org/en-US/u/mcaceres/ Marcos Caceres]&lt;br /&gt;
| ReSpec offers students the opportunity to work on a large code base that has extensive real world use and impact. The project offers students an extensive range of problems to tackle, from UI design, to concurrent processing (using Web Workers to do distributed text processing), dealing with accessibility and internationalization, writing and learning about unit and integration tests, security, code review, etc. - as well as exposure to the W3C and the web standards community, this project also aims at teaching students about how web standards are put together. To determine if this is a project you would like to be part of, see the [https://github.com/w3c/respec/issues/ list of issues] you could work on. It&#039;s a great opportunity to learn about all aspects of open source software development, but with the freedom to take on small to large challenges over the Summer (depending on your skill level and level of confidence). About the mentor: Marcos Caceres is a Staff Engineer at Mozilla who has been working on Web Standards for over a decade. Marcos is the lead maintainer of ReSpec. Marcos has extensive experience mentoring developers and has previously successfully mentor a GSO student. &lt;br /&gt;
|-&lt;br /&gt;
| D3D11 backend for gfx-rs HAL&lt;br /&gt;
| [https://github.com/gfx-rs/gfx gfx-rs] is a graphics abstraction library written in Rust and currently used for prototyping and investigation of [https://www.khronos.org/blog/khronos-announces-the-vulkan-portability-initiative Vulkan Portability] and [https://www.w3.org/community/gpu/ WebGPU] by Mozilla. The Hardware Abstraction Layer (HAL) of gfx-rs currently supports Vulkan, D3D12, Metal, and OpenGL. We want it to be powering [https://github.com/servo/webrender/ WebRender] for Firefox Quantum and Servo, and since WebRender currently runs on D3D11 (through [https://chromium.googlesource.com/angle/angle/+/master/README.md Angle]), we need to provide a native D3D11 backend. The implementation can be based off the existing D3D11 code in [https://github.com/gfx-rs/gfx/tree/pre-ll/src/backend/dx11 gfx-rs pre-HAL], and the main challenge is porting the code, optimizing, and ensuring it can successfully run the reference test suite.&lt;br /&gt;
| Candidates should be familiar with Rust as well as low-level graphics development. Not having D3D11-specific experience is acceptable, given the willingness to learn it and a properly setup Windows development environment.&lt;br /&gt;
| Dzmitry Malyshau (Mozilla)&lt;br /&gt;
| Dzmitry Malyshau (Mozilla)&lt;br /&gt;
| Proposal Timeline:&lt;br /&gt;
* Before April 20: setup the Windows environment for DirectX development; run the examples and reference tests with existing Vulkan/DX12/GL backends; get in contact with developers on [https://gitter.im/gfx-rs/gfx Gitter].&lt;br /&gt;
* April 20 – May 23: get familiar with gfx-rs HAL architecture, attempt to fix small entry-level issues and/or write an application/library on top of it.&lt;br /&gt;
* May 23 – May 30: setup the backend skeleton with bits of actual logic, such as device initialization, and have it building on CI.&lt;br /&gt;
* June 1 – July 5: implement the DX11 logic necessary to run the `quad` example and pass the basic graphics reference tests.&lt;br /&gt;
* July 6 - July 31: implement support for compute and tessellation; benchmark the new backend against DX12; pass the full reference test suite.&lt;br /&gt;
* Aug 1 - Aug 16: determine the list of capabilities that need to be exposed, merge it with GL backend legacy capabilities, expose to the reference tests.&lt;br /&gt;
|-&lt;br /&gt;
| Servo: Prototype ways of splitting up the script crate&lt;br /&gt;
| [https://github.com/servo/servo/ Servo] is a web rendering engine written in Rust. One specific module contains a huge amount of code that is expensive to compile all at once. This project is intended to explore ways of splitting it into separate modules to achieve better build performance without breaking the complex set of interdependencies that exist in the code.&lt;br /&gt;
| Candidates should be familiar with Rust, in particular using it in projects made of multiple crates and relying on features like traits and associated types.&lt;br /&gt;
| [https://mozillians.org/en-US/u/jdm/ Josh Matthews] (Mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/jdm/ Josh Matthews] (Mozilla)&lt;br /&gt;
| [https://github.com/servo/servo/wiki/Prototype-ways-of-splitting-the-script-crate Full project description page]&lt;br /&gt;
|-&lt;br /&gt;
| web-platform-tests: Improve test manifest workflow and performance&lt;br /&gt;
| [https://github.com/w3c/web-platform-tests/ web-platform-tests] is a project for writing a cross-browser test suite, which is used across all major browser engines. The list of tests is stored in a JSON manifest file which is slow to generate and which we currently check in to the Firefox repo. These things create a poor developer experience. The goal of the project is to move to a system where the manifest is downloaded on demand for Firefox developers, and then to explore ways to speed up manifest generation such as employing parallelism or moving performance hotspots to Rust. &lt;br /&gt;
| Candidates should be confident programming in Python.&lt;br /&gt;
| [https://github.com/jgraham James Graham] (Mozilla)&lt;br /&gt;
| [https://github.com/jgraham James Graham] (Mozilla)&lt;br /&gt;
| [https://github.com/jgraham/web-platform-tests/wiki/Improve-Test-Manifest-Workflow-and-Performance Full project description page]&lt;br /&gt;
|-&lt;br /&gt;
| WasmFiddle&lt;br /&gt;
| [https://wasdk.github.io/WasmFiddle/ WasmFiddle] is a web application that facilitates learning of the WebAssembly and its usage in the browser. The goal is to create a learning tool that will allow user to quickly start a project that uses WebAssembly, learn based on examples, explore existing popular toolchains (emscripten, rust, etc), etc. The project will be similar to what jsfiddle, jsbin, or codepen proposes, but with additional elements specific to WebAssembly only, e.g. a code generation from C/C++ languages or how the code will be compiled by the browser and run in native machine code.&lt;br /&gt;
| Languages or skills needed: JavaScript, HTML, CSS, WebAssembly. Suggested additional technologies: React, Rust, C++.&lt;br /&gt;
| Yury Delendik (Mozilla)&lt;br /&gt;
| Yury Delendik (Mozilla)&lt;br /&gt;
| The project involves extending the functionality of the existing WasmFiddle/WasmExplorer projects to:&lt;br /&gt;
* control, inspect and understand every part of the WebAssembly compilation pipeline;&lt;br /&gt;
* don’t hide details or add magic build steps;&lt;br /&gt;
* users can create, modify, fork and share fiddles, to reduce friction, no accounts;&lt;br /&gt;
* influence JavaScript developers through well-thought out examples, best practices and templates;&lt;br /&gt;
* add support for many languages: C/C++/Rust/etc;&lt;br /&gt;
* create environments where users can play and have fun with: WebGL, Physics, Games, Audio Synthesizers&lt;br /&gt;
|-&lt;br /&gt;
| Pontoon&#039;s path to first contribution&lt;br /&gt;
| Pontoon is Mozilla&#039;s localization tool, used by hundreds of contributors to translate Firefox, mozilla.org, and many other Mozilla products. It is critical to shipping Firefox to as many users as possible, all around the world. This year, we would like to improve the experience of first-time users of Pontoon. Your task would consist of defining a &amp;quot;path to first contribution&amp;quot;, and making it as smooth as possible. That mainly involves adding a tutorial to walk users through the translation interface and reworking the landing page, all of that using recent front-end technologies in a fast-evolving application.&lt;br /&gt;
| JavaScript, HTML, CSS, Python, UX. Django and React are pluses&lt;br /&gt;
| [https://mozillians.org/en-US/u/adrian/ Adrian Gaudebert] (Mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/adrian/ Adrian Gaudebert] (Mozilla)&lt;br /&gt;
|-&lt;br /&gt;
| AOM - accessibility API&lt;br /&gt;
| [https://github.com/WICG/aom/blob/gh-pages/explainer.md AOM] is JavaScript API designed to help the authors to make the web pages accessible, i.e. make them usable by the assisstive technologies such as screen readers, screen magnifiers and others. AOM specification is inspired by [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA ARIA] standard, an HTML 5 extension, used to add semantics to the web pages. If you are familiar with ARIA, then you can think of AOM as JavaScript ARIA. The AOM proposal (phase 1) was already implemented in Chrome under a flag, and you can help do the same in Firefox.&lt;br /&gt;
| Languages or skills needed: C++. &lt;br /&gt;
| Alexander Surkov (Mozilla) (surkov.alexander@gmail.com)&lt;br /&gt;
| Alexander Surkov (Mozilla) (surkov.alexander@gmail.com)&lt;br /&gt;
| This project is the opportunity to hack on the heart of Mozilla Firefox, the Gecko engine. It involves working with a large code base and solving a wide variety of problems, from the solution architecture to finding efficient ways to implement it. If you want to learn about Gecko and accessibility, that&#039;s the right place. AOM has the potential of becoming a new standard in making the web page accessible next few years. You can help to happen it sooner.&lt;br /&gt;
|-&lt;br /&gt;
| metricsgraphics - zooming and brushing&lt;br /&gt;
| [https://github.com/mozilla/metricsgraphics metricsgraphics] is JavaScript library designed to help with the presentation of interactive visualization. It is used extensively both inside and outside Mozilla. This project would be about adding a set of zooming and brushing features to facilitate the exploration of large and/or noisy datasets, such as in the [https://wiki.mozilla.org/EngineeringProductivity/Projects/Perfherder Perfherder] or [https://github.com/mozilla/missioncontrol/ Mission Control] projects. Detailed project description to come.&lt;br /&gt;
| Languages or skills needed: JavaScript, HTML/SVG&lt;br /&gt;
| William Lachance (Mozilla)&lt;br /&gt;
| William Lachance (Mozilla)&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Iodide Notebook&lt;br /&gt;
| The [https://github.com/mozilla/iodide Iodide Notebook] is a pure client-side browser-based IDE and publication tool for scientific computing and computational inquiry using web technologies (HTML, CSS, Javascript, WebAssembly). It provides a Jupyter-style notebook interface, granting scientists full access to the power of the DOM and browser APIs within a familiar iterative workflow, and with zero overhead -- absolutely no software installation and configuration is required, so people can seamlessly learn from and extend the work of others.&lt;br /&gt;
&lt;br /&gt;
Students will contribute to: extending the functionality of the notebook; making the notebook code more robust and performant; helping to shape the user experience; and creating example notebooks.&lt;br /&gt;
| JS; HTML; CSS; React/Redux; familiarity with at least one scientific computing language preferred (ex: MATLAB, Mathematica, Julia, Numpy/Scipy, R, etc). Science/math background is a major plus.&lt;br /&gt;
| Brendan Colloran (bcolloran@mozilla.com)&lt;br /&gt;
| Brendan Colloran (bcolloran@mozilla.com)&lt;br /&gt;
| In addition to helping to build the notebook, actively dogfooding it will be an essential part of our work. This means that students with a scientific and/or applied math background will be encouraged to build example notebooks that demonstrate visualizations, simulations, data analyses, etc., on topics of their choosing. In addition to mentoring students on software development, we will provide mentorship in scientific computing and data science.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Improved Pulse Inspector Backend&lt;br /&gt;
| [https://github.com/taskcluster/taskcluster-rfcs/issues/104 More details here]. The idea is to create a backend service that will allow browser-side applications like [https://tools.taskcluster.net/pulse-inspector/ pulse inspector] to listen to arbitrary [http://pulseguardian.mozilla.org/ Pulse] messages.&lt;br /&gt;
| JavaScript (server-side), AMQP, WebSockets&lt;br /&gt;
| Dustin Mitchell (Mozilla)&lt;br /&gt;
| Jonas Jensen (Mozilla) / Eli (Perelman Mozilla)&lt;br /&gt;
| This project can largely be a generic read-only websocket proxy for RabbitMQ, refer to our [https://github.com/taskcluster/taskcluster-rfcs/issues/104 issue for more details].&lt;br /&gt;
|-&lt;br /&gt;
| Redash - Improve user experience of [https://sql.telemetry.mozilla.org STMO]&lt;br /&gt;
| Mozilla runs an [https://sql.telemetry.mozilla.org/ instance] of the Open Source project [https://github.com/getredash/redash Redash], a data analysis and dashboarding tool that has been customized and configured for use with a number of the Firefox organization&#039;s data sets. It provides low barrier access to the vast amount of Firefox Telemetry data (and others) to make product decisions for Firefox and others projects.&lt;br /&gt;
| Languages or skills needed: Python, JavaScript, HTML&lt;br /&gt;
| [https://mozillians.org/en-US/u/jezdez/ Jannis Leidel (jezdez)] (Mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/jezdez/ Jannis Leidel (jezdez)] (Mozilla)&lt;br /&gt;
| Knowing SQL or having experience with data analysis is not a hard requirement to work on user experience improvements of the Redash tool itself. Instead this GSoC project is targeted at web developers who enjoy improving tools that have a great impact on how Firefox is developed. Please also see the [https://docs.telemetry.mozilla.org/ Firefox data documentation] for a more detailed [https://docs.telemetry.mozilla.org/tools/stmo.html introduction into Mozilla&#039;s Redash instance]. A goal of this GSoC project is to upstream all improvements made to the upstream Redash project when possible.&lt;br /&gt;
|-&lt;br /&gt;
| Automatically detect web compatibility issues ([https://github.com/marco-c/autowebcompat autowebcompat])&lt;br /&gt;
| Build a tool to automatically detect web compatibility issues using machine learning tools.&lt;br /&gt;
| Python (knowing Keras or having experience with machine learning is a plus)&lt;br /&gt;
| [mailto:marco@mozilla.com Marco (:marco)] (Mozilla)&lt;br /&gt;
| [mailto:marco@mozilla.com Marco (:marco)] (Mozilla)&lt;br /&gt;
| The project involves collecting data (screenshots of websites in different browsers), labeling it, training a neural network to automatically detect when a website is rendered differently in different browsers.&lt;br /&gt;
|-&lt;br /&gt;
| Autogeneration of style structs in Servo&#039;s style system&lt;br /&gt;
| Prototype how to run [https://github.com/rlhunt/cbindgen cbindgen] on Servo&#039;s style system [https://github.com/servo/servo/tree/master/components/style/values values module] to auto-generate style struct definitions for C++ and Rust, which would enable the removal of 5k+ [https://github.com/servo/servo/blob/master/components/style/properties/gecko.mako.rs lines] of unsafe and slow Rust &amp;lt;-&amp;gt; C++ conversion code. This can be done on a per-struct basis, so prototyping the general mechanism with a simple one like [https://github.com/servo/servo/blob/master/components/style/properties/longhand/color.mako.rs color] would be the first step, migrating more and more as time goes on.&lt;br /&gt;
| Primarily Rust (though no need to be really advanced), probably a bit Python for build system integration, and basic C++ since it needs to get generated.&lt;br /&gt;
| [https://github.com/emilio emilio]&lt;br /&gt;
| [https://github.com/emilio emilio]&lt;br /&gt;
| [https://github.com/servo/servo/wiki/Autogeneration-of-style-structs Full project description]&lt;br /&gt;
|-&lt;br /&gt;
| Timely Security Analytics&lt;br /&gt;
| InfoSec uses the Mozilla Defense Platform, MozDef to aggregate logs and alert on time series.  This project seeks to create a structure for extract, transform, load operations (ETL) to process these time series events using MapReduce (Apache Spark). The project will have three milestones:&lt;br /&gt;
* Demonstrated ability to load data from Mozilla SCL3, MDC1, MDC2 to GCP or AWS and process in apache spark.  Student shall have choice of languages: scala, python, etc.&lt;br /&gt;
* Demonstrated ability to reason about the MozDef standard data format using map reduce.  Produce anomalies for known incident patterns in AWS CloudTrail logs.  ( Example: An IAM user or service account used a service they have never used or logged in from a new GeoLocation / IP address tuple. )&lt;br /&gt;
* Demonstrated abilility to reason about non structured data (non-MozDef standard format) and correlate with MozDef structured events.&lt;br /&gt;
For more information see: [https://docs.google.com/document/d/1pzVbFw5TM8gG01Jabi4aOxAhiMvHGUHZTG-hV4dtAQs/edit?usp=sharing Google Doc]&lt;br /&gt;
| Languages or skills needed: Python, Scala, Javascript, ETL, AWS/GCP, Data Science Fundamentals, Apache Spark, Pig, or other big data.&lt;br /&gt;
| [https://mozillians.org/en-US/u/akrug/ Andrew Krug :akrug (mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/akrug/ Andrew Krug :akrug (mozilla)&lt;br /&gt;
[https://mozillians.org/en-US/u/michalpurzynski/] Michal Purzynski :michal` (mozilla)&lt;br /&gt;
| This project represents a unique opportunity to work on one of the only fully open source SIEM projects in the community -- MozDef.  The MozDef platform is running in production at Mozilla and ingests 14,000,000 events per year.  The current alert system uses time series rules to generate meaningful alerts for the infosec team and Mozilla&#039;s Operations Center.  We&#039;re hoping that with the help of qualified student(s) this rich data set can also generate alerts using basic machine learning techniques.  This is a unique opportunity to work on aggregation of disparate sources of data: NSM, CloudTrail, etc. into spark. Real-time alerts over large quantities of data. &lt;br /&gt;
|-&lt;br /&gt;
| C++ Static Analysis&lt;br /&gt;
| Add new checkers specific to our base code.&lt;br /&gt;
| Strong C++ experience and clang infrastructure.&lt;br /&gt;
| [mailto:s@mozilla.com Sylvestre]&lt;br /&gt;
| [mailto:andi@mozilla.com Andi]&lt;br /&gt;
| In order to tackle issues during the development phase, Mozilla wrote a [https://hg.mozilla.org/mozilla-central/file/tip/build/clang-plugin bunch of static analyzers checkers] based on [http://clang.llvm.org/extra/clang-tidy/ clang-tidy]. In this project, we will focus on writing more checkers (either generic to C/C++ or specific to Gecko programming patterns).   &lt;br /&gt;
|-&lt;br /&gt;
| Download Spam Protection for Firefox&lt;br /&gt;
| In Firefox, we want websites to go through a permission prompt if they want to initiate several downloads in an automated (not user-initiated) fashion. The project will involve implementing a permission prompt, implementing the logic of when it should be triggered, and collecting data (via telemetry, etc) on how users interact with the prompt in order to verify how the feature behaves.&lt;br /&gt;
| Good JavaScript experience and a basic understand of how the web works.&lt;br /&gt;
| [mailto:jhofmann@mozilla.com Johann (:johannh)]&lt;br /&gt;
| [mailto:nhnt11+gsoc@gmail.com Nihanth (:nhnt11)]&lt;br /&gt;
| A more detailed description can be found [https://bugzilla.mozilla.org/show_bug.cgi?id=1306334#c2 here]&lt;br /&gt;
|-&lt;br /&gt;
| TLS scanning in Rust for Mozilla TLS Observatory &lt;br /&gt;
| [https://github.com/mozilla/tls-observatory Mozilla TLS Observatory] is a hosted service that provides hindsight and compliance checking on the configuration of HTTPS servers. The goal of this project is to rewrite the [https://github.com/mozilla/cipherscan ciphersuite scanner] in Rust to support scanning TLS 1.3, but also maintain the ability to scan old version of TLS, all the way back to SSL2.0. This will likely require interacting with older versions of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Performance is also a strong requirement for this project. TLS Observatory scans thousands of sites every hour, and saving precious seconds on each scans make a big difference to the infrastructure.&lt;br /&gt;
&lt;br /&gt;
Finally, because this is a replacement of Cipherscan, this project requires maintaining backward compatibility with integrations that rely on specific flags, or json outputs.&lt;br /&gt;
&lt;br /&gt;
The final goal is to ship this project into the production infrastructure of TLS Observatory.&lt;br /&gt;
| Programming skills in C and Rust. Strong understanding of TLS and micro-services architectures.&lt;br /&gt;
| [mailto:jvehent@mozilla.com Julien Vehent]&lt;br /&gt;
| [mailto:jvehent@mozilla.com Julien Vehent]&lt;br /&gt;
| Cipherscan is the measuring tool that Mozilla uses to keep on eye on TLS configurations across the Internet. It is instrumental to the TLS guidelines work we do over at [https://wiki.mozilla.org/Security/Server_Side_TLS Server Side TLS]. This project will directly contribute to tooling that operators rely on worldwide to keep their websites secure.&lt;br /&gt;
&lt;br /&gt;
This is a fairly complex project that requires programming, networking and cryptography skills. Candidates will require skills in all three areas to succeed (GSoC is not long enough to learn them on the go).&lt;br /&gt;
|-&lt;br /&gt;
| Multi-tab select in Firefox&lt;br /&gt;
| This project will focus on adding multiple-select functionality to the tab strip in Firefox. The selected student will teach Firefox to know about multiple tabs being selected, while also adding functionality to close, and move to new window.&lt;br /&gt;
| JavaScript, CSS, and web experience&lt;br /&gt;
| [mailto:jaws@mozilla.com Jared Wein (:jaws)]&lt;br /&gt;
| [mailto:jaws@mozilla.com Jared Wein (:jaws)]&lt;br /&gt;
| You can learn more by [https://bugzilla.mozilla.org/show_bug.cgi?id=566510 reading the bug on Bugzilla], but note that the comments there stem back multiple years as people have been wanting this feature for a long time. While working on this you will become very familiar with the [https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox Browser Toolbox], our own &amp;quot;Inspector&amp;quot; tool for the browser user-interface, as well as writing automated tests for the new feature you&#039;re adding. Most of our tab-selection code lives within [https://searchfox.org/mozilla-central/source/browser/base/content/tabbrowser.xml our tabbrowser.xml] file, which you can browse around if you&#039;re interested to see how some operations work.&lt;br /&gt;
|-&lt;br /&gt;
| ..your project here!&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Community:SummerOfCode18:Brainstorming&amp;diff=1187058</id>
		<title>Community:SummerOfCode18:Brainstorming</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Community:SummerOfCode18:Brainstorming&amp;diff=1187058"/>
		<updated>2018-01-18T17:57:57Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mozilla community members - submit proposals here for 2018 Google Summer of Code projects with Mozilla. (If this page looks empty, it&#039;s because accepted ideas have already been transferred to the [[Community:SummerOfCode18|official list]].) Our application for summer of 2018 goes into Google on &#039;&#039;&#039;January 23rd&#039;&#039;&#039;, so get those project ideas in quickly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Are you a student looking to apply to SoC with Mozilla?&amp;lt;/b&amp;gt; Your first stop should be the [[Community:SummerOfCode18|official list of ideas]]. This page is full of weird ideas, some of which are still on here for a reason - it could be that they are not properly defined, the wrong size, or don&#039;t have a mentor. That makes them less likely to get accepted. You &amp;lt;i&amp;gt;can&amp;lt;/i&amp;gt;, of course, also submit your own ideas - you don&#039;t have to put an idea on this page and get it &#039;made official&#039; in order to send in a proposal for it.&lt;br /&gt;
&lt;br /&gt;
==How To Write A Good Project Proposal==&lt;br /&gt;
&lt;br /&gt;
Before adding an proposal to this list, please consider the following:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Be specific&#039;&#039;&#039;. It&#039;s hard to understand the impact of, or the size of, vague proposals.&lt;br /&gt;
* &#039;&#039;&#039;Consider size&#039;&#039;&#039;. The student has eight weeks to design, code, test and document the proposal. It needs to fill, but not overfill, that time.&lt;br /&gt;
* &#039;&#039;&#039;Do your research&#039;&#039;&#039;. Support the idea with well-researched links.&lt;br /&gt;
* &#039;&#039;&#039;Don&#039;t morph other people&#039;s ideas&#039;&#039;&#039;. If you have a related idea, place it next to the existing one, or add a comment. &lt;br /&gt;
* &#039;&#039;&#039;Insert only your own name into the Mentor column&#039;&#039;&#039;, and then only if you are willing to take on the responsibility. If you think the SoC admins won&#039;t know who you are, leave contact details.&lt;br /&gt;
* &#039;&#039;&#039;Check back regularly&#039;&#039;&#039;. The administrators may have questions about your idea that you will need to answer.&lt;br /&gt;
* &#039;&#039;&#039;Know when to give up&#039;&#039;&#039;. If you&#039;ve added the same idea for the last three years and it hasn&#039;t made it to the official page, perhaps you can predict what will happen this time.&lt;br /&gt;
&lt;br /&gt;
==Suggestion List==&lt;br /&gt;
&lt;br /&gt;
[[SummerOfCode|Here are the ideas lists from previous years]].&lt;br /&gt;
&lt;br /&gt;
Proposals can be in almost any part of the Mozilla project - don&#039;t be fooled by the &amp;quot;Code&amp;quot; in &amp;quot;Summer of Code&amp;quot;. If there is no category below for your part of Mozilla, add one!&lt;br /&gt;
&lt;br /&gt;
Here is the template for adding project proposals. Feel free to add new proposal to existing general categories, or add new categories as appropriate. &lt;br /&gt;
&lt;br /&gt;
== General category or project name ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;standard-table&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border-collapse: collapse&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Title &lt;br /&gt;
! Details &lt;br /&gt;
! Skills Needed &lt;br /&gt;
! Reporter &lt;br /&gt;
! Mentor(s) &lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Title of your proposal&lt;br /&gt;
| A few sentences describing the project.&lt;br /&gt;
| Languages or skills needed&lt;br /&gt;
| Project submitter&#039;s info&lt;br /&gt;
| Project mentor&#039;s info&lt;br /&gt;
| Anything else people might need to know about this submission.&lt;br /&gt;
|-&lt;br /&gt;
| ReSpec &lt;br /&gt;
| [https://github.com/w3c/respec/ ReSpec] is a JS-based tool used to write W3C Specifications (Web Standards) that is widely used by the Web Standards Community. With 5+ years of development, it&#039;s heavily depended upon by the W3C community at large (of which Mozilla is an active participant). ReSpec&#039;s code is in need of some modernization, optimizations, and bug fixes - and we could use your help! In this project, you would have the opportunity to make ReSpec&#039;s UI more accessible, making it leaner and faster using distributed processing with Web Workers, and/or adding new features to make the lives of W3C spec Editor&#039;s better. &lt;br /&gt;
| Languages or skills needed: JavaScript, HTML, CSS. &lt;br /&gt;
| Marcos Caceres (Mozilla)&lt;br /&gt;
| Marcos Caceres (Mozilla)&lt;br /&gt;
| ReSpec offers students the opportunity to work on a large code base that has extensive real world use and impact. The project offers students an extensive range of problems to tackle, from UI design, to concurrent processing (using Web Workers to do distributed text processing), dealing with accessibility and internationalization, writing and learning about unit and integration tests, security, code review, etc. - as well as exposure to the W3C and the web standards community, this project also aims at teaching students about how web standards are put together. To determine if this is a project you would like to be part of, see the [https://github.com/w3c/respec/issues/ list of issues] you could work on. It&#039;s a great opportunity to learn about all aspects of open source software development, but with the freedom to take on small to large challenges over the Summer (depending on your skill level and level of confidence). About the mentor: Marcos Caceres is a Staff Engineer at Mozilla who has been working on Web Standards for over a decade. Marcos is the lead maintainer of ReSpec. Marcos has extensive experience mentoring developers and has previously successfully mentor a GSO student. &lt;br /&gt;
|-&lt;br /&gt;
| D3D11 backend for gfx-rs HAL&lt;br /&gt;
| [https://github.com/gfx-rs/gfx gfx-rs] is a graphics abstraction library written in Rust and currently used for prototyping and investigation of [https://www.khronos.org/blog/khronos-announces-the-vulkan-portability-initiative Vulkan Portability] and [https://www.w3.org/community/gpu/ WebGPU] by Mozilla. The Hardware Abstraction Layer (HAL) of gfx-rs currently supports Vulkan, D3D12, Metal, and OpenGL. We want it to be powering [https://github.com/servo/webrender/ WebRender] for Firefox Quantum and Servo, and since WebRender currently runs on D3D11 (through [https://chromium.googlesource.com/angle/angle/+/master/README.md Angle]), we need to provide a native D3D11 backend. The implementation can be based off the existing D3D11 backend of [https://github.com/gfx-rs/gfx/tree/pre-ll/src/backend/dx11 gfx-rs pre-HAL], and the main challenge is porting the code, optimizing, and testing it.&lt;br /&gt;
| Candidates should be familiar with Rust as well as low-level graphics development. Not having D3D11-specific experience is acceptable, given the willingness to learn it and a properly setup Windows development environment.&lt;br /&gt;
| Dzmitry Malyshau (Mozilla)&lt;br /&gt;
| Dzmitry Malyshau (Mozilla)&lt;br /&gt;
| gfx-rs is one of the foundational projects in Rust gamedev/graphics, with rich history and wide range of users. We have an active community that encourages learning and curiosity in how graphics works down to the hardware. This is not a Mozilla project, but it may become a key component in Firefox Quantum for the ability to run natively on different platforms, while utilizing the fine-grained control of the graphics/compute workloads exposed by the low-level APIs.&lt;br /&gt;
|-&lt;br /&gt;
| Servo: Prototype ways of splitting up the script crate&lt;br /&gt;
| [https://github.com/servo/servo/ Servo] is a web rendering engine written in Rust. One specific module contains a huge amount of code that is expensive to compile all at once. This project is intended to explore ways of splitting it into separate modules to achieve better build performance without breaking the complex set of interdependencies that exist in the code.&lt;br /&gt;
| Candidates should be familiar with Rust, in particular using it in projects made of multiple crates and relying on features like traits and associated types.&lt;br /&gt;
| [https://mozillians.org/en-US/u/jdm/ Josh Matthews] (Mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/jdm/ Josh Matthews] (Mozilla)&lt;br /&gt;
| [https://github.com/servo/servo/wiki/Prototype-ways-of-splitting-the-script-crate Full project description page]&lt;br /&gt;
|-&lt;br /&gt;
| web-platform-tests: Improve test manifest workflow and performance&lt;br /&gt;
| [https://github.com/w3c/web-platform-tests/ web-platform-tests] is a project for writing a cross-browser test suite, which is used across all major browser engines. The list of tests is stored in a JSON manifest file which is slow to generate and which we currently check in to the Firefox repo. These things create a poor developer experience. The goal of the project is to move to a system where the manifest is downloaded on demand for Firefox developers, and then to explore ways to speed up manifest generation such as employing parallelism or moving performance hotspots to Rust. &lt;br /&gt;
| Candidates should be confident programming in Python.&lt;br /&gt;
| [https://github.com/jgraham James Graham] (Mozilla)&lt;br /&gt;
| [https://github.com/jgraham James Graham] (Mozilla)&lt;br /&gt;
|-&lt;br /&gt;
| WasmFiddle&lt;br /&gt;
| [https://wasdk.github.io/WasmFiddle/ WasmFiddle] is a web application that facilitates learning of the WebAssembly and its usage in the browser. The goal is to create a learning tool that will allow user to quickly start a project that uses WebAssembly, learn based on examples, explore existing popular toolchains (emscripten, rust, etc), etc. The project will be similar to what jsfiddle, jsbin, or codepen proposes, but with additional elements specific to WebAssembly only, e.g. a code generation from C/C++ languages or how the code will be compiled by the browser and run in native machine code.&lt;br /&gt;
| Languages or skills needed: JavaScript, HTML, CSS, WebAssembly. Suggested additional technologies: React, Rust, C++.&lt;br /&gt;
| Yury Delendik (Mozilla)&lt;br /&gt;
| Yury Delendik (Mozilla)&lt;br /&gt;
| The project involves extending the functionality of the existing WasmFiddle/WasmExplorer projects to:&lt;br /&gt;
* control, inspect and understand every part of the WebAssembly compilation pipeline;&lt;br /&gt;
* don’t hide details or add magic build steps;&lt;br /&gt;
* users can create, modify, fork and share fiddles, to reduce friction, no accounts;&lt;br /&gt;
* influence JavaScript developers through well-thought out examples, best practices and templates;&lt;br /&gt;
* add support for many languages: C/C++/Rust/etc;&lt;br /&gt;
* create environments where users can play and have fun with: WebGL, Physics, Games, Audio Synthesizers&lt;br /&gt;
|-&lt;br /&gt;
| Pontoon&#039;s path to first contribution&lt;br /&gt;
| Pontoon is Mozilla&#039;s localization tool, used by hundreds of contributors to translate Firefox, mozilla.org, and many other Mozilla products. It is critical to shipping Firefox to as many users as possible, all around the world. This year, we would like to improve the experience of first-time users of Pontoon. Your task would consist of defining a &amp;quot;path to first contribution&amp;quot;, and making it as smooth as possible. That mainly involves adding a tutorial to walk users through the translation interface and reworking the landing page, all of that using recent front-end technologies in a fast-evolving application.&lt;br /&gt;
| JavaScript, HTML, CSS, Python, UX. Django and React are pluses&lt;br /&gt;
| [https://mozillians.org/en-US/u/adrian/ Adrian Gaudebert] (Mozilla)&lt;br /&gt;
| [https://mozillians.org/en-US/u/adrian/ Adrian Gaudebert] (Mozilla)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| AOM - accessibility API&lt;br /&gt;
| [https://github.com/WICG/aom/blob/gh-pages/explainer.md AOM] is JavaScript API designed to help the authors to make the web pages accessible, i.e. make them usable by the assisstive technologies such as screen readers, screen magnifiers and others. AOM specification is inspired by [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA ARIA] standard, an HTML 5 extension, used to add semantics to the web pages. If you are familiar with ARIA, then you can think of AOM as JavaScript ARIA. The AOM proposal (phase 1) was already implemented in Chrome under a flag, and you can help do the same in Firefox.&lt;br /&gt;
| Languages or skills needed: C++. &lt;br /&gt;
| Alexander Surkov (Mozilla)&lt;br /&gt;
| Alexander Surkov (Mozilla)&lt;br /&gt;
| This project is the opportunity to hack on the heart of Mozilla Firefox, the Gecko engine. It involves working with a large code base and solving a wide variety of problems, from the solution architecture to finding efficient ways to implement it. If you want to learn about Gecko and accessibility, that&#039;s the right place. AOM has the potential of becoming a new standard in making the web page accessible next few years. You can help to happen it sooner.&lt;br /&gt;
|-&lt;br /&gt;
| Another proposal, etc.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1184904</id>
		<title>Modules/Core</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1184904"/>
		<updated>2017-11-28T13:23:16Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Only module owners may edit this page.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
They may:&lt;br /&gt;
&lt;br /&gt;
* update any information about their module except the name of the owner&lt;br /&gt;
* add or remove sub-modules&lt;br /&gt;
* change the owner of a sub-module &lt;br /&gt;
* add emeritus owners or peers&lt;br /&gt;
&lt;br /&gt;
Other changes, including changes of module owner or addition/removal of modules, must be agreed with the Module Ownership Module group, probably via a discussion in [https://www.mozilla.org/about/forums/#governance mozilla.governance].&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Accessibility&lt;br /&gt;
|description=Support for platform accessibility APIs. Accessibility APIs are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and UI controls, as well as important events like changes of focus.&lt;br /&gt;
|owner=[mailto:surkov.alexander@gmail.com Alexander Surkov]&lt;br /&gt;
|peers=[mailto:dbolter@mozilla.com David Bolter], [mailto:eitan@monotonous.org Eitan Isaacson], [mailto:jteh@mozilla.com James Teh],  [mailto:mzehe@mozilla.com Marco Zehe], [mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|ownersemeritus=[mailto:aaron@moonset.net. Aaron Leventhal]&lt;br /&gt;
|peersemeritus=[mailto:tbsaunde+mozbugs@tbsaunde.org Trevor Saunders], [mailto:ginn.chen@oracle.com Ginn Chen], Evan Yan&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Browser WebAPI&lt;br /&gt;
|description=Web API for rendering apps, browser windows and widgets.&lt;br /&gt;
|owner=[mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:fabrice@mozilla.com Fabrice Desré]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/browser-element/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build and Release Tools&lt;br /&gt;
|description=Tools related to build and release automation and configuration of release builds.&lt;br /&gt;
|owner=[mailto:nthomas@mozilla.com Nick Thomas]&lt;br /&gt;
|peers=[mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:coop@mozilla.com Chris Cooper]&lt;br /&gt;
|group=release-engineering&lt;br /&gt;
|source_dirs=browser/config/mozconfigs/, mobile/android/config/mozconfigs/, xulrunner/config/mozconfigs/, b2g/config/, tools/update-packaging/&lt;br /&gt;
|url=https://wiki.mozilla.org/ReleaseEngineering&lt;br /&gt;
|components=Release Engineering::*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config&lt;br /&gt;
|description=The build system for Gecko and several mozilla.org hosted Gecko-based applications.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc] (:gps)&lt;br /&gt;
|peers=[mailto:mh@glandium.org Mike Hommey] (:glandium), [mailto:mshal@mozilla.com Mike Shal] (:mshal), [mailto:ted@mielczarek.org Ted Mielczarek] (:ted), [mailto:cmanchester@mozilla.com Chris Manchester](:chmanchester), [mailto:nfroyd@mozilla.com Nathan Froyd] (:froydnj), [mailto:rgiles@mozilla.com Ralph Giles] (:rillian)&lt;br /&gt;
|ownersemeritus=Ted Mielczarek (2008-[https://blog.mozilla.org/ted/2013/03/07/gregory-szorc-is-now-the-build-config-module-owner/ 2013]), Benjamin Smedberg (???-[http://benjamin.smedbergs.us/blog/2008-04-30/more-changing-of-the-guard-ted-mielczarek/ 2008]), &lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|source_dirs=build/, config/, python/mozbuild, tools/cross-commit, tools/cvs2hg-import.py, tools/cvsmgmt/, tools/elf-dynstr-gc/, tools/trees.pl, browser/config/mozconfigs/, mobile/config/mozconfigs/, xulrunner/config/mozconfigs/&lt;br /&gt;
|url=http://www.mozilla.org/build/&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Code Analysis and Debugging Tools&lt;br /&gt;
|description=Tools for debugging Mozilla code or for analyzing speed, memory use, and other characteristics of it.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-performance&lt;br /&gt;
|source_dirs=tools/codesighs/, tools/debug/, tools/dreftool/, tools/dumpdeps/, tools/footprint/, tools/jprof/, tools/leaky/, tools/memory/, tools/module-deps/, tools/performance/, tools/post_compile/, tools/preloader/, tools/rb/, tools/reorder/, tools/trace-malloc/, tools/uuiddeps/, &lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content HTTP Headers&lt;br /&gt;
|description=HTTP headers related to content, e.g. User-Agent, Content-Type, Accept. (Transport-related headers are the responsibility of the Necko module owner.)&lt;br /&gt;
|owner=[mailto:gerv@mozilla.org Gervase Markham]&lt;br /&gt;
|peers=[mailto:lmandel@mozilla.com Lawrence Mandel]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs= &lt;br /&gt;
|url=https://developer.mozilla.org/en/Gecko_user_agent_string_reference&lt;br /&gt;
|components=Core::Networking: HTTP&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content Security&lt;br /&gt;
|description=Native content-based security features, including: Content Security Policy (CSP), Mixed Content Blocker (MCB), Subresource Integrity (SRI) and CORS.&lt;br /&gt;
|owner=[mailto:ckerschbaumer@mozilla.com Christoph Kerschbaumer]&lt;br /&gt;
|peers=[mailto:francois@mozilla.com François Marier], [mailto:jonas@sicking.cc Jonas Sicking],  [mailto:tvyas@mozilla.com Tanvi Vyas], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:mozilla@sidstamm.com Sid Stamm] &lt;br /&gt;
|group=dev-security&lt;br /&gt;
|source_dirs=dom/security&lt;br /&gt;
|components=Core::DOM: Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cookies and Permissions&lt;br /&gt;
|description=&lt;br /&gt;
|owner=Monica Chew&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.com Josh Matthews], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:mconnor@steelgryphon.com Mike Connor], [mailto:dwitte@gmail.com Dan Witte], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sdwilsh@shawnwilsher.com Shawn Wilsher (ping on irc)]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=extensions/cookie/, netwerk/cookie/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Networking: Cookies&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cycle Collector&lt;br /&gt;
|description=Code to break and collect objects within reference cycles&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/mccr8/ Andrew McCreight]&lt;br /&gt;
|peers=Peter Van der Beken, Olli Pettay, David Baron&lt;br /&gt;
|source_dirs=xpcom/base/nsCycleCollector.* and some support headers&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=C++/Rust usage, tools, and style&lt;br /&gt;
|description=Aspects of C++ use such as language feature usage, standard library versions/usage, compiler/toolchain versions, formatting and naming style, and aspects of Rust use as needs arise&lt;br /&gt;
|owner=[mailto:nfroyd@mozilla.com Nathan Froyd] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:glandium@mozilla.com Mike Hommey], [mailto:jwalden@mozilla.com Jeff Walden], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|source_dirs=non-third-party C++ and Rust code in the tree&lt;br /&gt;
|components=Various components&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=docshell&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:sawang@mozilla.com Samael Wang]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback],[mailto:cbiesinger@gmail.com Christian Biesinger],[mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=docshell/, uriloader/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Document Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Document Object Model&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:hsivonen@iki.fi Henri Sivonen], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:baku@mozilla.com Andrea Marchesini],&lt;br /&gt;
[mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:kyle@nonpolynomial.com Kyle Machulis]&lt;br /&gt;
|ownersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|peersemeritus=[mailto:justin.lebar@gmail.com Justin Lebar], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:bent.mozilla@gmail.com Ben Turner], [mailto:mounir@lamouri.fr Mounir Lamouri (still active, but slower to respond than previously)], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/*, except directories covered by other modules&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM, Core::DOM: CSS Object Model, Core::DOM: Core &amp;amp; HTML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=DOM File&lt;br /&gt;
|description=DOM Blob, File and FileSystem APIs &lt;br /&gt;
|owner=[mailto:amarchesini@Mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:olli@pettay.fi Olli Pettay]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/file, dom/filesystem&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Event Handling&lt;br /&gt;
|description=DOM Events and Event Handling &lt;br /&gt;
|owner=[mailto:olli@pettay.fi Olli Pettay], [mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=[mailto:sshih@mozilla.com Stone Shih]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/events and event handling related code elsewhere &lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: Events, Core::Event Handling&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Workers&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:mrbkap@mozilla.com Blake Kaplan], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey], [mailto:bkelly@mozilla.com Ben Kelly]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/workers/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_web_workers&lt;br /&gt;
|components=Core::DOM: Workers&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IndexedDB&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|peers=[mailto:btseng@mozilla.com Bevis Tseng], [mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/indexedDB/&lt;br /&gt;
|url=https://developer.mozilla.org/en/IndexedDB&lt;br /&gt;
|components=Core::DOM: IndexedDB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Editor&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=editor/&lt;br /&gt;
|url=http://www.mozilla.org/editor/&lt;br /&gt;
|components=Core::Editor&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Embedding&lt;br /&gt;
|description=Gecko embedding APIs and frameworks&lt;br /&gt;
|owner=[mailto:myk@mykzilla.org Myk Melez]&lt;br /&gt;
|ownersemeritus=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:bdahl@mozilla.com Brendan Dahl], [mailto:tbsaunde@tbsaunde.org Trevor Saunders]&lt;br /&gt;
|peersemeritus=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=embedding/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Find As You Type&lt;br /&gt;
|description=Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). Currently seeks new owner.&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=extensions/typeaheadfind/&lt;br /&gt;
|url=http://www.mozilla.org/access/type-ahead/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Gecko Profiler&lt;br /&gt;
|description=Gecko&#039;s built-in profiler&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:nnethercote@mozilla.com Nicholas Nethercote], [mailto:jseward@mozilla.com Julian Seward] (LUL), [mailto:kvijayan@mozilla.com Kannan Vijayan] (JS integration), [mailto:shu@mozilla.com Shu-yu Guo] (JS integration), [mailto:tlee@mozilla.com Thinker Lee] (TaskTracer), [mailto:cyu@mozilla.com Cervantes Yu] (TaskTracer), [mailto:b56girard@gmail.com Benoit Girard].&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=tools/profiler/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler&lt;br /&gt;
|components=Core::Gecko Profiler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Geolocation&lt;br /&gt;
|description=Implementation of the Geolocation W3C Spec, location provider apis, and wifi scanning code.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews], [mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner], Garvan Keeley&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/geolocation, dom/system/, netwerk/wifi&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_geolocation&lt;br /&gt;
|components=Core::Geolocation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Global Key Bindings&lt;br /&gt;
|description=Global hot keys in Mozilla for the browser, editor, mail-news and widgets. Does not include underlined menu accelerators and the like, as those are part of i18n.&lt;br /&gt;
|owner=Aaron Leventhal&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=dom/xbl/builtin/&lt;br /&gt;
|url=http://www.mozilla.org/projects/ui/accessibility/mozkeyintro.html&lt;br /&gt;
|components=Core::Keyboard: Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Graphics&lt;br /&gt;
|description=Mozilla graphics API&lt;br /&gt;
|owner=[mailto:jrmuizel@mozilla.com Jeff Muizelaar](Thebes, QCMS, YCbCr, Cairo/Pixman, Regions, OS X, Other)&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:jdrew@mozilla.com Joe Drew], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:bas.schouten@live.nl Bas Schouten](Layers, Windows), [mailto:bjacob@mozilla.com Benoit Jacob](gfx/gl), [mailto:bgirard@mozilla.com Benoit Girard](Compositor, Performance), [mailto:ajuma.bugzilla@alijuma.com Ali Juma], [mailto:jgilbert@mozilla.com Jeff Gilbert](WebGL, ANGLE), [mailto:george@mozilla.com George Wright](Canvas2D), [mailto:mwoodrow@mozilla.com Matt Woodrow](Layers API), [mailto:jdaggett@mozilla.com John Daggett](text/fonts), [mailto:jfkthame@googlemail.com Jonathan Kew](text/fonts), [mailto:nsilva@mozilla.com  Nicolas Silva](MozSurface), [mailto:ncameron@mozilla.com Nick Cameron], [mailto:sikeda@mozilla.com Sotaro Ikeda](B2G), [mailto:snorp@mozilla.com James Willcox](Android), [mailto:clord@mozilla.com Christopher Lord], [mailto:mstange@themasta.com Markus Stange](OS X), [mailto:lsalzman@mozilla.com Lee Salzman](Skia), [mailto:mchang@mozilla.com Mason Chang], [mailto:dvander@mozilla.com David Anderson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=gfx/, dom/canvas/&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX https://wiki.mozilla.org/Gecko:Layers https://wiki.mozilla.org/Gecko:2DGraphicsSketch&lt;br /&gt;
|components=Core::Graphics, Core::Graphics: Layers, Core::Graphics: Text, Core::GFX: Color Management, Core::Canvas: 2D, Core::Canvas: WebGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=APZ (Graphics submodule)&lt;br /&gt;
|description=Asynchronous panning and zooming&lt;br /&gt;
|owner=[mailto:kgupta@mozilla.com Kartikaya Gupta]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:tnikkel@mozilla.com Timothy Nikkel], [mailto:dvander@mozilla.com David Anderson], [mailto:mstange@mozilla.com Markus Stange]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/layers/apz&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/APZ&lt;br /&gt;
|components=Core::Panning and Zooming&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Moz2D (Graphics submodule)&lt;br /&gt;
|description=Platform independent 2D graphics API&lt;br /&gt;
|owner=[mailto:bschouten@mozilla.com Bas Schouten]&lt;br /&gt;
|peers=[mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:gwright@mozilla.com George Wright], [mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/2d&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/Moz2D&lt;br /&gt;
|components=Core::Graphics&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Legacy HTML Parser&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:mrbkap@gmail.com Blake Kaplan]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:rbs@maths.uq.edu.au rbs@maths.uq.edu.au]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|source_dirs=parser/htmlparser&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/doc/parser.html&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HAL&lt;br /&gt;
|description=Hardware Abstraction Layer&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands]&lt;br /&gt;
|peers=[mailto:gsvelto@mozilla.com Gabriele Svelto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=hal/&lt;br /&gt;
|components=Core::Hardware Abstraction Layer (HAL)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HTML Parser&lt;br /&gt;
|description=The HTML Parser transforms HTML source code into a DOM. It conforms to the HTML specification, and is mostly translated automatically from Java to C++.&lt;br /&gt;
|owner=[mailto:hsivonen@iki.fi Henri Sivonen]&lt;br /&gt;
|peers=[mailto:wchen@mozilla.com William Chen]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=parser/html&lt;br /&gt;
|url=http://about.validator.nu/&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=I18N Library&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jshin1987@gmail.com Jungshik Shin], [mailto:smontagu@smontagu.org Simon Montagu]&lt;br /&gt;
|peers=[mailto:VYV03354@nifty.ne.jp Masatoshi Kimura]&lt;br /&gt;
|group=dev-i18n&lt;br /&gt;
|source_dirs=intl/&lt;br /&gt;
|url=http://mozilla.org/projects/intl/index.html&lt;br /&gt;
|components=Core::Internationalization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=ImageLib&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:tnikkel@gmail.com Timothy Nikkel]&lt;br /&gt;
|peers=[mailto:aosmond@mozilla.com Andrew Osmond], [mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:seth.bugzilla@blackhail.net Seth Fowler]&lt;br /&gt;
|peersemeritus=[mailto:netzen@gmail.com Brian Bondy], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/libjpeg/, media/libpng/, image/, modules/zlib/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::ImageLib&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IPC&lt;br /&gt;
|description=Message-passing between threads and processes&lt;br /&gt;
|owner=[mailto:wmccloskey@mozilla.com Bill McCloskey]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:kchen@mozilla.com Kan-Ru Chen], [mailto:jld@mozilla.com Jed Davis], [mailto:nfroyd@mozilla.com Nathan Froyd], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:amccreight@mozilla.com Andrew McCreight]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/glue/, ipc/ipdl/, ipc/chromium/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript&lt;br /&gt;
|description=JavaScript engine (SpiderMonkey)&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:jdemooij@mozilla.com Jan de Mooij], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:nnethercote@mozilla.com Nick Nethercote], [mailto:jwalden@mit.edu Jeff Walden], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:evilpies@gmail.com Tom Schuster], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:till@tillschneidereit.net Till Schneidereit], [mailto:efaust@mozilla.com Eric Faust], [mailto:nfitzgerald@mozilla.com Nick Fitzgerald], [mailto:luke@mozilla.com Luke Wagner], [mailto:arai.unmht@gmail.com Tooru Fujisawa], [mailto:sunfish@mozilla.com Dan Gohman], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:nmatsakis@mozilla.com Niko Matsakis], [mailto:ejpbruel@mozilla.com Eddy Bruel], [mailto:danderson@mozilla.com David Anderson], [mailto:igor@mir2.org Igor Bukanov], [mailto:brendan@mozilla.org Brendan Eich], Andreas Gal&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey,&lt;br /&gt;
http://developer.mozilla.org/en/docs/About_JavaScript&lt;br /&gt;
|components=Core::JavaScript Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript JIT&lt;br /&gt;
|description=JavaScript engine&#039;s JIT compilers (IonMonkey, Baseline)&lt;br /&gt;
|owner=[mailto:jdemooij@mozilla.com Jan de Mooij]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:bbouvier@mozilla.com Benjamin Bouvier], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:nicolas.b.pierron@mozilla.com Nicolas Pierron], [mailto:evilpies@gmail.com  Tom Schuster], [mailto:sstangl@mozilla.com Sean Stangl], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:luke@mozilla.com Luke Wagner]&lt;br /&gt;
|group=dev-tech-js-engine-internals&lt;br /&gt;
|source_dirs=js/src/jit&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey&lt;br /&gt;
|components=Core::JavaScript Engine: JIT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript Debugger Backend&lt;br /&gt;
|description=JavaScript debugging hooks&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:rginda@hacksrus.com Rob Ginda]&lt;br /&gt;
|group=dev-apps-js-debugger&lt;br /&gt;
|source_dirs=js/jsd/&lt;br /&gt;
|url=http://www.mozilla.org/js/jsd&lt;br /&gt;
|components=Other Applications::Venkman JS Debugger&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=jsat&lt;br /&gt;
|description=Javascript screen reader that is used in Android and B2G&lt;br /&gt;
|owner=[mailto:eitan@monotonous.org Eitan Isaacson]&lt;br /&gt;
|peers=[mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/jsat/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-ctypes&lt;br /&gt;
|description=A foreign function interface which allows privileged JS code to interact with binary code without using XPCOM/XPConnect.&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src/ctypes/&lt;br /&gt;
|url=https://wiki.mozilla.org/JSctypes&lt;br /&gt;
|components=Core::js-ctypes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-tests&lt;br /&gt;
|description=JavaScript test suite&lt;br /&gt;
|owner=[mailto:bclary@bclary.com Bob Clary]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tests/&lt;br /&gt;
|url=http://www.mozilla.org/js/tests/library.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Layout Engine&lt;br /&gt;
|description=rendering tree construction, layout (reflow), etc.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:bzbarsky@mit.edu Boris Zbarsky],  [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:jfkthame@gmail.com Jonathan Kew], [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:matt.woodrow@gmail.com Matt Woodrow], [mailto:xidorn+moz@upsuper.org Xidorn Quan]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/%, layout/base/, layout/build/, layout/doc/, layout/forms/, layout/generic/, layout/html/, layout/printing/, layout/tables/, layout/tools/&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout, Core::Layout: Block and Inline, Core::Layout: Floats, Core::Layout: Form Controls, Core::Layout: HTML Frames, Core::Layout: Images, Core::Layout: Misc Code, Core::Layout: R &amp;amp; A Pos, Core::Layout: Tables, Core::Layout: Text, Core::Print Preview, Core::Printing: Output&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=libjar&lt;br /&gt;
|description=The JAR handling code (protocol handler, stream implementation, and zipreader/zipwriter).&lt;br /&gt;
|owner=[mailto:mwu@mozilla.com Michael Wu]&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libjar&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MathML&lt;br /&gt;
|description=MathML is a low-level specification for describing mathematics which provides a foundation for the inclusion of mathematical expressions in Web pages.&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-tech-mathml&lt;br /&gt;
|source_dirs=layout/mathml/&lt;br /&gt;
|url=http://www.mozilla.org/projects/mathml/&lt;br /&gt;
|components=Core::MathML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Playback&lt;br /&gt;
|description=HTML Media APIs, including Media Source Extensions and non-MSE video/audio element playback, and Encrypted Media Extensions. (WebRTC and WebAudio not included).&lt;br /&gt;
|owner=[mailto:cpearce@mozilla.com Chris Pearce]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:ajones@mozilla.com Anthony Jones], [mailto:kinetik@flim.org Matthew Gregan], [mailto:eflores@mozilla.com Edwin Flores], [mailto:jyavenard@mozilla.com Jean-Yves Avenard], [mailto:gsquelart@mozilla.com Gerald Squelart], [mailto:rgiles@mozilla.com Ralph Giles], [mailto:jwwang@mozilla.com JW Wang]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=dom/media, media/gmp-clearkey/, media/libcubeb/, media/libnestegg/, media/libogg/, media/libopus/, media/libstagefright/, media/libtheora/, media/libtremor/, media/libvorbis/, media/libvpx/, media/omx-plugin/, media/rlz/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Audio/Video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Transport&lt;br /&gt;
|description=Pluggable transport for real-time media&lt;br /&gt;
|owner=[mailto:ekr@rtfm.com Eric Rescorla]&lt;br /&gt;
|peers=[mailto:bcampen@mozilla.com Byron Campen], [mailto:abr@mozilla.com Adam Roach], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=media/mtransport&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::WebRTC::Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Memory Allocator&lt;br /&gt;
|description=Most things related to memory allocation in Gecko, including jemalloc, replace-malloc, DMD (dark matter detector), logalloc, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:n.nethercote@gmail.com Nicholas Nethercote], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=memory/&lt;br /&gt;
|components=Core::DMD, Core::jemalloc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mfbt&lt;br /&gt;
|description=mfbt is a collection of headers, macros, data structures, methods, and other functionality available for use and reuse throughout all Mozilla code (including SpiderMonkey and Gecko more broadly).&lt;br /&gt;
|owner=[mailto:jwalden@mit.edu Jeff Walden]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:Ms2ger@gmail.com Ms2ger], [mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mfbt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::MFBT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozApps API &amp;amp; UI&lt;br /&gt;
|description=Implementation of the navigator.mozApps API&lt;br /&gt;
|owner=[mailto:fabrice@mozilla.com Fabrice Desré], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:myk@mozilla.org Myk Melez], [mailto:mar.castelluccio@studenti.unina.it Marco Castelluccio], [mailto:ferjmoreno@gmail.com Fernando Jiménez]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/apps/, dom/interfaces/apps, product specific files implementing UI hooks.&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM: Apps&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Mozglue&lt;br /&gt;
|description=Glue library containing various low-level functionality, including a dynamic linker for Android, a DLL block list for Windows, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd] (mozglue/linker), [mailto:kgupta@mozilla.com Kartikaya Gupta] (mozglue/android), [mailto:nchen@mozilla.com Jim Chen] (mozglue/android)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mozglue/&lt;br /&gt;
|components=Core::mozglue&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozilla-toplevel&lt;br /&gt;
|description=The top level directory for the mozilla tree.&lt;br /&gt;
|owner=[mailto:brendan@mozilla.org Brendan Eich]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=tools/README&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MSCOM&lt;br /&gt;
|description=Integration with Microsoft Distributed COM&lt;br /&gt;
|owner=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|peers=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/mscom/%&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC: MSCOM}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Necko&lt;br /&gt;
|description=The Mozilla Networking Library&lt;br /&gt;
|owner=[mailto:mcmanus@ducksong.com Patrick McManus]&lt;br /&gt;
|peers= [mailto:jduell.mcbugs@gmail.com Jason Duell], [mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:mnovotny@mozilla.com Michal Novotny], [mailto:hurley@mozilla.com Nick Hurley], [mailto:dd.mozilla@gmail.com  Dragana Damjanovic ],[mailto:valentin.gosu@gmail.com Valentin Gosu],[mailto:daniel@haxx.se Daniel Stenberg ], [mailto:schien@mozilla.com ShihChiang Chien]&lt;br /&gt;
|peersemeritus= [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sworkman@mozilla.com Steve Workman], [mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=netwerk/%, netwerk/base/, netwerk/build/, netwerk/cache/, netwerk/dns/, netwerk/locales/, netwerk/mime/, netwerk/protocol/, netwerk/resources/, netwerk/socket/, netwerk/streamconv/, netwerk/system/, netwerk/test/, netwerk/testserver/&lt;br /&gt;
|url=http://www.mozilla.org/projects/netlib/, https://developer.mozilla.org/en/Necko&lt;br /&gt;
|components=Core::Networking, Core::Networking: Cache, Core::Networking: Cookies, Core::Networking: FTP, Core::Networking: File, Core::Networking: HTTP, Core::Networking: JAR, Core::Networking: Websockets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=NSPR&lt;br /&gt;
|description=Netscape Portable Runtime&lt;br /&gt;
|owner=[mailto:kaie@kuix.de Kai Engert]&lt;br /&gt;
|peers=[mailto:wtc@google.com Wan-Teh Chang], [mailto:mh@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-tech-nspr&lt;br /&gt;
|source_dirs=nsprpub/&lt;br /&gt;
|url=http://www.mozilla.org/projects/nspr/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/reference/html/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/release-notes/&lt;br /&gt;
|components=NSPR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PDF&lt;br /&gt;
|description=Rendering code to display documents encoded in the ISO 32000-1 `PDF&#039; format.&lt;br /&gt;
|owner=Chris Jones, Andreas Gal&lt;br /&gt;
|peers=[mailto:aadib@mozilla.com Artur Adib], [mailto:bdahl@mozilla.com Brendan Dahl], [mailto:vnicolas@mozilla.com Vivien Nicolas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/pdf/&lt;br /&gt;
|url=https://github.com/mozilla/pdf.js&lt;br /&gt;
|components=Core::PDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Plugins&lt;br /&gt;
|description= NPAPI Plugin support.&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:john@pointysoftware.net John Schoenick], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:jstenback@gmail.com Johnny Stenback], Benjamin Smedberg&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/plugins/, modules/plugin/&lt;br /&gt;
|url=https://wiki.mozilla.org/Plugins&lt;br /&gt;
|components=Core::Plug-ins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Preferences&lt;br /&gt;
|description=Preference library&lt;br /&gt;
|owner=[mailto:nnethercote@mozilla.com Nicholas Nethercote]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:felipe@mozilla.com Felipe Gomes], [mailto:glandium@mozilla.com Mike Hommey], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libpref/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Preferences: Backend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Private Browsing&lt;br /&gt;
|description=Implementation of the Private Browsing mode, and the integration of other modules with Private Browsing APIs.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=Implementation and consumers of Private Browsing APIs in nsILoadContext, nsIPrivateBrowsingChannel, PrivateBrowsingUtils.jsm and the related glue code. &lt;br /&gt;
|url=https://wiki.mozilla.org/Private_Browsing&lt;br /&gt;
|components=Firefox::Private Browsing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Privilege Manager&lt;br /&gt;
|description=&amp;quot;caps&amp;quot;&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peersemeritus=[mailto:brendan@mozilla.org Brendan Eich], [mailto:jstenback@gmail.com Johnny Stenback], [mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=caps/&lt;br /&gt;
|url=http://www.mozilla.org/projects/security/components/index.html&lt;br /&gt;
|components=Core::Security: CAPS&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Push Notifications&lt;br /&gt;
|description=Push is a way for application developers to send messages to their web applications.&lt;br /&gt;
|owners=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:nsm.nikhil@gmail.com Nikhil Marathe], [mailto:kcambridge@mozilla.com Kit Cambridge], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ddamjanovic@mozilla.com Dragana Damjanovic]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/push, dom/simplepush&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PyXPCOM&lt;br /&gt;
|description=The Python to XPCOM bridge.&lt;br /&gt;
|owner=Todd Whiteman&lt;br /&gt;
|peers=[mailto:mhammond@skippinet.com.au Mark Hammond]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=extension/python&lt;br /&gt;
|url=https://developer.mozilla.org/en/PyXPCOM&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=RDF&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:axel@pike.org Axel Hecht]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-rdf&lt;br /&gt;
|source_dirs=rdf/&lt;br /&gt;
|url=http://www.mozilla.org/rdf/doc/&lt;br /&gt;
|components=Core::RDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=security&lt;br /&gt;
|description=Crypto/PKI code, including NSS (Network Security Services) and JSS (NSS for Java)&lt;br /&gt;
|owner=[mailto:rrelyea@redhat.com Bob Relyea], [mailto:ttaubert@mozilla.com Tim Taubert]&lt;br /&gt;
|peers=[mailto:emaldona@redhat.com Elio Maldonado], [mailto:kaie@kuix.de Kai Engert], [mailto:ryan.sleevi@gmail.com Ryan Sleevi], [mailto:ekr@rtfm.com Eric Rescorla], [mailto:franziskuskiefer@gmail.com Franziskus Kiefer], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:wtc@google.com Wan-Teh Chang]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=dbm/, security/coreconf/, security/dbm/, security/jss/, security/nss/, security/tinderbox/, security/tinderlight/&lt;br /&gt;
|url=http://mozilla.org/projects/security/pki/&lt;br /&gt;
|components=NSS, JSS, Core::Security, Core::Security: S/MIME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Security - Mozilla PSM Glue&lt;br /&gt;
|description=Personal Security Manager&lt;br /&gt;
|owner=[mailto:dkeeler@mozilla.com David Keeler]&lt;br /&gt;
|peers=[mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:cykesiopka.bmo@gmail.com Cykesiopka]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=security/manager/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Security: PSM, Core::Security: UI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Static analysis &amp;amp; rewriting for C++&lt;br /&gt;
|description=Tools for checking C++ code looking for problems at compile time, plus tools for automated rewriting of C++ code.&lt;br /&gt;
|owner=[mailto:nika@thelayzells.com Nika Layzell] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:sfink@mozilla.com Steve Fink], [mailto:jrmuizel@mozilla.com Jeff Muizelaar], [mailto:birunthan@mohanathas.com Birunthan Mohanathas], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=build/clang-plugin, tools/rewriting among other out of tree tools&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Rewriting &amp;amp; Analysis&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=storage&lt;br /&gt;
|description=Storage APIs with a SQLite backend&lt;br /&gt;
|owner=[mailto:mak77@bonardo.net Marco Bonardo]&lt;br /&gt;
|peers=[mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=db/sqlite3/, storage/&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/Storage&lt;br /&gt;
|components=Toolkit::Storage, Core::SQL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=String&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=string/, xpcom/string/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Mozilla_internal_string_guide&lt;br /&gt;
|components=Core::String&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Style System&lt;br /&gt;
|description=CSS style sheet handling; style data computation&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:cam@mcc.id.au Cameron McCormack]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/style/&lt;br /&gt;
|url=https://wiki.mozilla.org/Gecko:Overview#Style_System&lt;br /&gt;
|components=Core::CSS Parsing and Computation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=SVG&lt;br /&gt;
|description=Scalable Vector Graphics&lt;br /&gt;
|owner=[mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|peers=[mailto:longsonr@gmail.com Robert Longson], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:birtles@gmail.com Brian Birtles]&lt;br /&gt;
|group=dev-tech-svg&lt;br /&gt;
|source_dirs=dom/svg/, layout/svg/, dom/smil/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Web/SVG&lt;br /&gt;
|components=Core::SVG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Tamarin&lt;br /&gt;
|description=VM for ActionScript and JavaScript&lt;br /&gt;
|owner=Edwin Smith, [mailto:jodyer@adobe.com Jeff Dyer]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:stejohns@adobe.com Steven Johnson], [mailto:tierney@adobe.com Erik Tierney], [mailto:treilly@adobe.com Tom Reilly]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tamarin&lt;br /&gt;
|url=http://www.mozilla.org/projects/tamarin/&lt;br /&gt;
http://wiki.mozilla.org/tamarin/&lt;br /&gt;
http://hg.mozilla.org/tamarin-central/&lt;br /&gt;
http://hg.mozilla.org/tamarin-tracing/&lt;br /&gt;
|components=Tamarin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Test Harness&lt;br /&gt;
|description=In-tree test infrastructure and tools. Harnesses include, XPCShell, Mochitest (&amp;amp; Chrome), Reftest, JsREftest, Compiled Code Tests, Robocop, Mozmill, Marionette, Firefox UI Tests. Requests for new harnesses should go to Testing::General.&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron] (reftest), [mailto:jwalden@mit.edu Jeff Walden] (httpd.js, jsreftest), Rob Campbell (mochitest, mochitest chrome, marionette), [mailto:jmaher@mozilla.com Joel Maher] (reftest, mochitest, jsreftest), [mailto:ctalbert@mozilla.com Clint Talbert] (reftest, compiled code, mozmill), [mailto:geoffbrown@mozilla.com Geoff Brown] (robocop), [mailto:hskupin@mozilla.com Henrik Skupin] (Marionette, Firefox UI tests), [mailto:ato@mozilla.com Andreas Tolfsen] (marionette), [mailto:jgriffin Jonathan Griffin] (marionette), [mailto:dburns@mozilla.com David Burns] (marionette), [mailto:dminor@mozilla.com Dan Minor], [mailto:mjzffr@gmail.com Maja Frydrychowicz] (Marionette, Firefox UI tests), &lt;br /&gt;
&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=/testing&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::General, Testing::Mochitest, Testing::Mochitest Chrome, Testing::Marionette, Testing::Mozmill, Testing::Reftest, Testing::XPCShell Harness, Testing::httpd.js&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Testing Infrastructure&lt;br /&gt;
|description=Testing tools and infrastructure for Mozilla projects, harnesses for automated tests, stand-alone test tools. Talos, Graph Server, Mozbase, Pulse, WOO, Bughunter, SUTAgent, Eideticker&lt;br /&gt;
|owner=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|peers=[mailto:bclary@bclary.com Bob Clary], [mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:ccooper@deadsquid.com Chris Cooper], [mailto:ctalbert@mozilla.com Clint Talbert], [mailto:robert@roberthelmer.com Robert Helmer], [mailto:jmaher@mozilla.com Joel Maher], Rob Campbell, [mailto:wlach@mozilla.com William Lachance], [mailto:jeads@mozilla.com Jonathan Eads], [mailto:jgriffin Jonathan Griffin], [mailto:bmoss@mozilla.com Bob Moss], [mailto:mcote@mozilla.com Mark Côté]&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=testing/, tools/httptester/, tools/page-loader/, tools/test-harness/, tools/tests/, tools/testserver/, tools/testy/&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::Infrastructure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JS Marionette&lt;br /&gt;
|description=NodeJS test harness, marionette client, and other utilities for running marionette tests (submodule of Test Infrastructure)&lt;br /&gt;
|owner=[mailto:jlal@mozilla.com James Lal] &amp;lt;lightsofapollo&amp;gt;, [mailto:gaye@mozilla.com Gareth Aye] &amp;lt;gaye&amp;gt;&lt;br /&gt;
|peers=[mailto:aus@mozilla.com Ghislain &amp;quot;Aus&amp;quot; Lacroix] &amp;lt;auswerk&amp;gt;&lt;br /&gt;
|source_dirs=gaia/tests/jsmarionette&lt;br /&gt;
|components=Testing::JSMarionette&lt;br /&gt;
|group=dev-gaia&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCShell Test Harness&lt;br /&gt;
|description=The XPCShell Harness&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|source_dirs=testing/xpcshell&lt;br /&gt;
|components=Testing::XPCShell Harness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Update Service&lt;br /&gt;
|description=server code for Mozilla Update services (aus, addons, pfs)&lt;br /&gt;
|owner=Mike Morgan&lt;br /&gt;
|peers=[mailto:jscott@mozilla.com Justin Scott], [mailto:shaver@mozilla.org Mike Shaver], [mailto:wclouser@mozilla.com Will Clouser]&lt;br /&gt;
|group=dev-amo&lt;br /&gt;
|source_dirs=webtools/addons/, webtools/aus/, webtools/update/&lt;br /&gt;
|url=http://wiki.mozilla.org/wiki/AMO&lt;br /&gt;
|components=AUS::Administration, AUS::Systems&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=View System&lt;br /&gt;
|description=The View Manager is responsible for handling &amp;quot;heavyweight&amp;quot; rendering (some clipping, compositing) and event handling tasks.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=view/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Layout: View Rendering&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Audio&lt;br /&gt;
|description=Support for the W3C Web Audio API specification.&lt;br /&gt;
|owner=[mailto:padenot@mozilla.com Paul Adenot]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/media/webaudio&lt;br /&gt;
|url=https://wiki.mozilla.org/Web_Audio_API&lt;br /&gt;
|components=Core::Web Audio&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Painting&lt;br /&gt;
|description=painting, display lists, and layer construction&lt;br /&gt;
|owner=[mailto:matt.woodrow@gmail.com Matt Woodrow]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dbaron@dbaron.org David Baron],   [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs= layout/painting, the display list and layer related methods on nsIFrame and its subclasses&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout: Web Painting&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC&lt;br /&gt;
|description=WebRTC is responsible for realtime audio and video communication, as well as related issues like low-level camera and microphone access&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:bcampen@mozilla.com Byron Campen] [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=netwerk/sctp (also see submodules &amp;quot;WebRTC Media&amp;quot; and &amp;quot;WebRTC Signaling&amp;quot;)&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC, Core::WebRTC Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebVR&lt;br /&gt;
|description=Gecko&#039;s implementation of WebVR (Virtual Reality) functionality, including API, devices, graphics and integration&lt;br /&gt;
|owner=[mailto:kgilbert@mozilla.com Kip Gilbert]&lt;br /&gt;
|peers=[mailto:dmu@mozilla.com Daosheng Mu]&lt;br /&gt;
|peersemeritus=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/vr, gfx/vr&lt;br /&gt;
|url=https://mozvr.com/&lt;br /&gt;
|components=Core::WebVR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peersemeritus=[mailto:pavlov@pavlov.net Stuart Parmenter], &lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/, widget/xpwidgets/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Drag and Drop, Core::Widget, Core::Printing: Setup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Android&lt;br /&gt;
|description=The Android Port&lt;br /&gt;
|owner=[mailto:blassey.bugs@lassey.us Brad Lassey]&lt;br /&gt;
|peers=[mailto:jwillcox@mozilla.com James Willcox]&lt;br /&gt;
|group=dev-platforms-mobile&lt;br /&gt;
|source_dirs=widget/android/, embedding/android&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Android&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - GTK&lt;br /&gt;
|description=supported X widgetry and gfx&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/gtk/, widget/gtk2/, widget/gtksuperwin/, widget/gtkxtbin/&lt;br /&gt;
|url=http://www.mozilla.org/unix/, http://www.gtk.org, http://www.mozilla.org/ports/gtk/&lt;br /&gt;
|components=Core::Widget: Gtk&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - OS X&lt;br /&gt;
|description= Gecko&#039;s OS X compatibility layer.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas], [mailto:bgirard@mozilla.com Benoit Girard], [mailto:spohl@mozilla.com Stephen Pohl], [mailto:smichaud@pobox.com Steven Michaud]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/cocoa/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Cocoa&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Windows&lt;br /&gt;
|description=Windows widgets and desktop integration&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peersemeritus=[mailto:blassey@mozilla.com Brad Lassey], [mailto:netzen@gmail.com Brian Bondy], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:doug.turner@gmail.com Doug Turner], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref], [mailto:robarnold@cmu.edu Rob Arnold]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/windows/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Win32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XBL&lt;br /&gt;
|description=eXtensible Binding Language&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|ownersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=dom/xbl/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xbl/&lt;br /&gt;
|components=Core::XBL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XML&lt;br /&gt;
|description=XML in Mozilla, including XML, XHTML, Namespaces in XML, Associating Style Sheets with XML Documents, XML Linking and XML Extras. XML-related things that are not covered by more specific projects.&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-tech-xml&lt;br /&gt;
|source_dirs=dom/xml/, extensions/xmlextras/, parser/expat/&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/xml/&lt;br /&gt;
|components=Core::XML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPApps&lt;br /&gt;
|description=Cross-Platform Applications, mostly Navigator front end and application shell.&lt;br /&gt;
|owner=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|peers=[mailto:dean_tessman@hotmail.com Dean Tessman], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-apps-seamonkey&lt;br /&gt;
|source_dirs=xpfe/&lt;br /&gt;
|url=http://www.mozilla.org/xpapps/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCOM&lt;br /&gt;
|description=The cross-platform object model and core data structures.&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd]&lt;br /&gt;
|peers=[mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|ownersemeritus=Benjamin Smedberg&lt;br /&gt;
|peersemeritus=[https://mozillians.org/en-US/u/dougt/ Doug Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=startupcache/, xpcom/%, xpcom/base/, xpcom/build/, xpcom/components/, xpcom/ds/, xpcom/glue/, xpcom/proxy/, xpcom/sample/, xpcom/stub/, xpcom/tests/, xpcom/threads/, xpcom/tools/, xpcom/windbgdlg/&lt;br /&gt;
|url=http://developer.mozilla.org/en/XPCOM&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPConnect&lt;br /&gt;
|description=Deep Magic&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:gkrizsanits@mozilla.com Gabor Krizsanits], [mailto:amccreight@mozilla.com Andrew McCreight], [mailto:kmaglione@mozilla.com Kris Maglione]&lt;br /&gt;
|peersemeritus=[mailto:gal@uci.edu Andreas Gal], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=js/xpconnect/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::XPConnect&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPIDL&lt;br /&gt;
|description=Cross-platform IDL compiler; produces .h C++ header files and .xpt runtime type description files from .idl interface description files.&lt;br /&gt;
|owner=[mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|peersemeritus=[mailto:shaver@mozilla.org Mike Shaver], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=xpcom/typelib/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xpidl&lt;br /&gt;
http://www.mozilla.org/scriptable&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPInstall&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-xpinstall&lt;br /&gt;
|source_dirs=xpinstall/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Installer: XPInstall Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPToolkit&lt;br /&gt;
|description=Cross-platform user interface toolkit&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Jan.Varga@gmail.com Jan Varga]&lt;br /&gt;
|group=dev-tech-xul&lt;br /&gt;
|source_dirs=dom/xul/, layout/xul/&lt;br /&gt;
|url=http://www.mozilla.org/xpfe/&lt;br /&gt;
|components=Core::XP Toolkit/Widgets: Menus, Core::XP Toolkit/Widgets: XUL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XSLT Processor&lt;br /&gt;
|description=XSLT transformations processor&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:axel@pike.org Axel Hecht], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xslt&lt;br /&gt;
|source_dirs=dom/xslt/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xslt/, http://www.w3.org/TR/xslt.html&lt;br /&gt;
|components=Core::XSLT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing&lt;br /&gt;
|description=Cross platform sandboxing&lt;br /&gt;
|owner=[mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|peers=[mailto:bowen@mozilla.com Bob Owen], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:gDestuynder@mozilla.com Guillaume Destuynder], [mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Windows &lt;br /&gt;
|description=Sandboxing for the Windows platform &lt;br /&gt;
|owner=[mailto:bowen@mozilla.com Bob Owen]&lt;br /&gt;
|peers=[mailto:netzen@gmail.com Brian Bondy], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:jimm@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/win &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - OSX &lt;br /&gt;
|description=Sandboxing for the OSX platform &lt;br /&gt;
|owner=[mailto:haftandilian@mozilla.com Haik Aftandilian]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox/mac &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing -  Linux &amp;amp; B2G&lt;br /&gt;
|description=Sandboxing for the Linux &amp;amp; B2G platforms&lt;br /&gt;
|owner=[mailto:jhector@mozilla.com Julian Hector]&lt;br /&gt;
|peers=[mailto:jld@mozilla.com Jed Davis] [mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/linux&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Submodules===&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Fennec&lt;br /&gt;
|description=Submodule of the build config covering Fennec&#039;s build system in mobile/android.&lt;br /&gt;
|owner=[mailto:nalexander@mozilla.com Nicholas Alexander]&lt;br /&gt;
|peers=Same as Build Config&lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Media&lt;br /&gt;
|description=Submodule of WebRTC responsible for access to media input devices (microphones, cameras, screen capture), as well as realtime audiovisual codecs and packetization.&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:jib@mozilla.com Jan-Ivar Bruaroey], [mailto:dminor@mozilla.com Dan Minor], [mailto:apehrson@mozilla.com Andreas Pehrson], &lt;br /&gt;
|peersemeritus=[mailto:pkerr@mozilla.com Paul Kerr], [mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc, /dom/media/webrtc, /dom/media/systemservices&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Audio/Video)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Signaling&lt;br /&gt;
|description=Submodule of WebRTC responsible for implementation of PeerConnection API, WebRTC identity, and SDP/JSEP handling&lt;br /&gt;
|owner=[mailto:bcampen@mozilla.com Byron Campen]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:abr@mozilla.com Adam Roach], [mailto:rjesup@mozilla.com Randell Jesup], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc/signaling/&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Signaling)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unassigned Bugzilla Components===&lt;br /&gt;
&lt;br /&gt;
The following Bugzilla components in the Core project have not been assigned to a module (this list is not exhaustive):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Core::File Handling&lt;br /&gt;
Core::Find Backend&lt;br /&gt;
Core::Gecko Profiler&lt;br /&gt;
Core::General&lt;br /&gt;
Core::HTML: Form Submission&lt;br /&gt;
Core::History: Global&lt;br /&gt;
Core::Image Blocking&lt;br /&gt;
Core::JavaScript Debugging APIs&lt;br /&gt;
Core::Localization&lt;br /&gt;
Core::Nanojit&lt;br /&gt;
Core::Networking: Domain Lists&lt;br /&gt;
Core::Print Preview&lt;br /&gt;
Core::Printing: Output&lt;br /&gt;
Core::Printing: Setup&lt;br /&gt;
Core::Profile: BackEnd&lt;br /&gt;
Core::Profile: Migration&lt;br /&gt;
Core::Profile: Roaming&lt;br /&gt;
Core::QuickLaunch (AKA turbo mode)&lt;br /&gt;
Core::Rewriting and Analysis&lt;br /&gt;
Core::Selection&lt;br /&gt;
Core::Serializers&lt;br /&gt;
Core::Spelling checker&lt;br /&gt;
Core::Tracking&lt;br /&gt;
Core::Web Services&lt;br /&gt;
Core::WebDAV&lt;br /&gt;
Core::Widget: OS/2&lt;br /&gt;
Core::Widget: Photon&lt;br /&gt;
Core::X-remote&lt;br /&gt;
Core::XForms&lt;br /&gt;
Core::XUL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1184903</id>
		<title>Modules/Core</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1184903"/>
		<updated>2017-11-28T13:22:33Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Only module owners may edit this page.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
They may:&lt;br /&gt;
&lt;br /&gt;
* update any information about their module except the name of the owner&lt;br /&gt;
* add or remove sub-modules&lt;br /&gt;
* change the owner of a sub-module &lt;br /&gt;
* add emeritus owners or peers&lt;br /&gt;
&lt;br /&gt;
Other changes, including changes of module owner or addition/removal of modules, must be agreed with the Module Ownership Module group, probably via a discussion in [https://www.mozilla.org/about/forums/#governance mozilla.governance].&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Accessibility&lt;br /&gt;
|description=Support for platform accessibility APIs. Accessibility APIs are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and UI controls, as well as important events like changes of focus.&lt;br /&gt;
|owner=[mailto:surkov.alexander@gmail.com Alexander Surkov]&lt;br /&gt;
|peers=[mailto:dbolter@mozilla.com David Bolter], [mailto:eitan@monotonous.org Eitan Isaacson],[mailto:jteh@mozilla.com James Teh],  [mailto:mzehe@mozilla.com Marco Zehe], [mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|ownersemeritus=[mailto:aaron@moonset.net. Aaron Leventhal]&lt;br /&gt;
|peersemeritus=[mailto:tbsaunde+mozbugs@tbsaunde.org Trevor Saunders], [mailto:ginn.chen@oracle.com Ginn Chen], Evan Yan&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Browser WebAPI&lt;br /&gt;
|description=Web API for rendering apps, browser windows and widgets.&lt;br /&gt;
|owner=[mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:fabrice@mozilla.com Fabrice Desré]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/browser-element/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build and Release Tools&lt;br /&gt;
|description=Tools related to build and release automation and configuration of release builds.&lt;br /&gt;
|owner=[mailto:nthomas@mozilla.com Nick Thomas]&lt;br /&gt;
|peers=[mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:coop@mozilla.com Chris Cooper]&lt;br /&gt;
|group=release-engineering&lt;br /&gt;
|source_dirs=browser/config/mozconfigs/, mobile/android/config/mozconfigs/, xulrunner/config/mozconfigs/, b2g/config/, tools/update-packaging/&lt;br /&gt;
|url=https://wiki.mozilla.org/ReleaseEngineering&lt;br /&gt;
|components=Release Engineering::*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config&lt;br /&gt;
|description=The build system for Gecko and several mozilla.org hosted Gecko-based applications.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc] (:gps)&lt;br /&gt;
|peers=[mailto:mh@glandium.org Mike Hommey] (:glandium), [mailto:mshal@mozilla.com Mike Shal] (:mshal), [mailto:ted@mielczarek.org Ted Mielczarek] (:ted), [mailto:cmanchester@mozilla.com Chris Manchester](:chmanchester), [mailto:nfroyd@mozilla.com Nathan Froyd] (:froydnj), [mailto:rgiles@mozilla.com Ralph Giles] (:rillian)&lt;br /&gt;
|ownersemeritus=Ted Mielczarek (2008-[https://blog.mozilla.org/ted/2013/03/07/gregory-szorc-is-now-the-build-config-module-owner/ 2013]), Benjamin Smedberg (???-[http://benjamin.smedbergs.us/blog/2008-04-30/more-changing-of-the-guard-ted-mielczarek/ 2008]), &lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|source_dirs=build/, config/, python/mozbuild, tools/cross-commit, tools/cvs2hg-import.py, tools/cvsmgmt/, tools/elf-dynstr-gc/, tools/trees.pl, browser/config/mozconfigs/, mobile/config/mozconfigs/, xulrunner/config/mozconfigs/&lt;br /&gt;
|url=http://www.mozilla.org/build/&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Code Analysis and Debugging Tools&lt;br /&gt;
|description=Tools for debugging Mozilla code or for analyzing speed, memory use, and other characteristics of it.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-performance&lt;br /&gt;
|source_dirs=tools/codesighs/, tools/debug/, tools/dreftool/, tools/dumpdeps/, tools/footprint/, tools/jprof/, tools/leaky/, tools/memory/, tools/module-deps/, tools/performance/, tools/post_compile/, tools/preloader/, tools/rb/, tools/reorder/, tools/trace-malloc/, tools/uuiddeps/, &lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content HTTP Headers&lt;br /&gt;
|description=HTTP headers related to content, e.g. User-Agent, Content-Type, Accept. (Transport-related headers are the responsibility of the Necko module owner.)&lt;br /&gt;
|owner=[mailto:gerv@mozilla.org Gervase Markham]&lt;br /&gt;
|peers=[mailto:lmandel@mozilla.com Lawrence Mandel]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs= &lt;br /&gt;
|url=https://developer.mozilla.org/en/Gecko_user_agent_string_reference&lt;br /&gt;
|components=Core::Networking: HTTP&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content Security&lt;br /&gt;
|description=Native content-based security features, including: Content Security Policy (CSP), Mixed Content Blocker (MCB), Subresource Integrity (SRI) and CORS.&lt;br /&gt;
|owner=[mailto:ckerschbaumer@mozilla.com Christoph Kerschbaumer]&lt;br /&gt;
|peers=[mailto:francois@mozilla.com François Marier], [mailto:jonas@sicking.cc Jonas Sicking],  [mailto:tvyas@mozilla.com Tanvi Vyas], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:mozilla@sidstamm.com Sid Stamm] &lt;br /&gt;
|group=dev-security&lt;br /&gt;
|source_dirs=dom/security&lt;br /&gt;
|components=Core::DOM: Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cookies and Permissions&lt;br /&gt;
|description=&lt;br /&gt;
|owner=Monica Chew&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.com Josh Matthews], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:mconnor@steelgryphon.com Mike Connor], [mailto:dwitte@gmail.com Dan Witte], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sdwilsh@shawnwilsher.com Shawn Wilsher (ping on irc)]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=extensions/cookie/, netwerk/cookie/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Networking: Cookies&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cycle Collector&lt;br /&gt;
|description=Code to break and collect objects within reference cycles&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/mccr8/ Andrew McCreight]&lt;br /&gt;
|peers=Peter Van der Beken, Olli Pettay, David Baron&lt;br /&gt;
|source_dirs=xpcom/base/nsCycleCollector.* and some support headers&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=C++/Rust usage, tools, and style&lt;br /&gt;
|description=Aspects of C++ use such as language feature usage, standard library versions/usage, compiler/toolchain versions, formatting and naming style, and aspects of Rust use as needs arise&lt;br /&gt;
|owner=[mailto:nfroyd@mozilla.com Nathan Froyd] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:glandium@mozilla.com Mike Hommey], [mailto:jwalden@mozilla.com Jeff Walden], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|source_dirs=non-third-party C++ and Rust code in the tree&lt;br /&gt;
|components=Various components&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=docshell&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:sawang@mozilla.com Samael Wang]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback],[mailto:cbiesinger@gmail.com Christian Biesinger],[mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=docshell/, uriloader/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Document Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Document Object Model&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:hsivonen@iki.fi Henri Sivonen], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:baku@mozilla.com Andrea Marchesini],&lt;br /&gt;
[mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:kyle@nonpolynomial.com Kyle Machulis]&lt;br /&gt;
|ownersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|peersemeritus=[mailto:justin.lebar@gmail.com Justin Lebar], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:bent.mozilla@gmail.com Ben Turner], [mailto:mounir@lamouri.fr Mounir Lamouri (still active, but slower to respond than previously)], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/*, except directories covered by other modules&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM, Core::DOM: CSS Object Model, Core::DOM: Core &amp;amp; HTML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=DOM File&lt;br /&gt;
|description=DOM Blob, File and FileSystem APIs &lt;br /&gt;
|owner=[mailto:amarchesini@Mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:olli@pettay.fi Olli Pettay]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/file, dom/filesystem&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Event Handling&lt;br /&gt;
|description=DOM Events and Event Handling &lt;br /&gt;
|owner=[mailto:olli@pettay.fi Olli Pettay], [mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=[mailto:sshih@mozilla.com Stone Shih]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/events and event handling related code elsewhere &lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: Events, Core::Event Handling&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Workers&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:mrbkap@mozilla.com Blake Kaplan], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey], [mailto:bkelly@mozilla.com Ben Kelly]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/workers/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_web_workers&lt;br /&gt;
|components=Core::DOM: Workers&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IndexedDB&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|peers=[mailto:btseng@mozilla.com Bevis Tseng], [mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/indexedDB/&lt;br /&gt;
|url=https://developer.mozilla.org/en/IndexedDB&lt;br /&gt;
|components=Core::DOM: IndexedDB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Editor&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=editor/&lt;br /&gt;
|url=http://www.mozilla.org/editor/&lt;br /&gt;
|components=Core::Editor&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Embedding&lt;br /&gt;
|description=Gecko embedding APIs and frameworks&lt;br /&gt;
|owner=[mailto:myk@mykzilla.org Myk Melez]&lt;br /&gt;
|ownersemeritus=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:bdahl@mozilla.com Brendan Dahl], [mailto:tbsaunde@tbsaunde.org Trevor Saunders]&lt;br /&gt;
|peersemeritus=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=embedding/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Find As You Type&lt;br /&gt;
|description=Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). Currently seeks new owner.&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=extensions/typeaheadfind/&lt;br /&gt;
|url=http://www.mozilla.org/access/type-ahead/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Gecko Profiler&lt;br /&gt;
|description=Gecko&#039;s built-in profiler&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:nnethercote@mozilla.com Nicholas Nethercote], [mailto:jseward@mozilla.com Julian Seward] (LUL), [mailto:kvijayan@mozilla.com Kannan Vijayan] (JS integration), [mailto:shu@mozilla.com Shu-yu Guo] (JS integration), [mailto:tlee@mozilla.com Thinker Lee] (TaskTracer), [mailto:cyu@mozilla.com Cervantes Yu] (TaskTracer), [mailto:b56girard@gmail.com Benoit Girard].&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=tools/profiler/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler&lt;br /&gt;
|components=Core::Gecko Profiler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Geolocation&lt;br /&gt;
|description=Implementation of the Geolocation W3C Spec, location provider apis, and wifi scanning code.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews], [mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner], Garvan Keeley&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/geolocation, dom/system/, netwerk/wifi&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_geolocation&lt;br /&gt;
|components=Core::Geolocation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Global Key Bindings&lt;br /&gt;
|description=Global hot keys in Mozilla for the browser, editor, mail-news and widgets. Does not include underlined menu accelerators and the like, as those are part of i18n.&lt;br /&gt;
|owner=Aaron Leventhal&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=dom/xbl/builtin/&lt;br /&gt;
|url=http://www.mozilla.org/projects/ui/accessibility/mozkeyintro.html&lt;br /&gt;
|components=Core::Keyboard: Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Graphics&lt;br /&gt;
|description=Mozilla graphics API&lt;br /&gt;
|owner=[mailto:jrmuizel@mozilla.com Jeff Muizelaar](Thebes, QCMS, YCbCr, Cairo/Pixman, Regions, OS X, Other)&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:jdrew@mozilla.com Joe Drew], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:bas.schouten@live.nl Bas Schouten](Layers, Windows), [mailto:bjacob@mozilla.com Benoit Jacob](gfx/gl), [mailto:bgirard@mozilla.com Benoit Girard](Compositor, Performance), [mailto:ajuma.bugzilla@alijuma.com Ali Juma], [mailto:jgilbert@mozilla.com Jeff Gilbert](WebGL, ANGLE), [mailto:george@mozilla.com George Wright](Canvas2D), [mailto:mwoodrow@mozilla.com Matt Woodrow](Layers API), [mailto:jdaggett@mozilla.com John Daggett](text/fonts), [mailto:jfkthame@googlemail.com Jonathan Kew](text/fonts), [mailto:nsilva@mozilla.com  Nicolas Silva](MozSurface), [mailto:ncameron@mozilla.com Nick Cameron], [mailto:sikeda@mozilla.com Sotaro Ikeda](B2G), [mailto:snorp@mozilla.com James Willcox](Android), [mailto:clord@mozilla.com Christopher Lord], [mailto:mstange@themasta.com Markus Stange](OS X), [mailto:lsalzman@mozilla.com Lee Salzman](Skia), [mailto:mchang@mozilla.com Mason Chang], [mailto:dvander@mozilla.com David Anderson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=gfx/, dom/canvas/&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX https://wiki.mozilla.org/Gecko:Layers https://wiki.mozilla.org/Gecko:2DGraphicsSketch&lt;br /&gt;
|components=Core::Graphics, Core::Graphics: Layers, Core::Graphics: Text, Core::GFX: Color Management, Core::Canvas: 2D, Core::Canvas: WebGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=APZ (Graphics submodule)&lt;br /&gt;
|description=Asynchronous panning and zooming&lt;br /&gt;
|owner=[mailto:kgupta@mozilla.com Kartikaya Gupta]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:tnikkel@mozilla.com Timothy Nikkel], [mailto:dvander@mozilla.com David Anderson], [mailto:mstange@mozilla.com Markus Stange]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/layers/apz&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/APZ&lt;br /&gt;
|components=Core::Panning and Zooming&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Moz2D (Graphics submodule)&lt;br /&gt;
|description=Platform independent 2D graphics API&lt;br /&gt;
|owner=[mailto:bschouten@mozilla.com Bas Schouten]&lt;br /&gt;
|peers=[mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:gwright@mozilla.com George Wright], [mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/2d&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/Moz2D&lt;br /&gt;
|components=Core::Graphics&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Legacy HTML Parser&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:mrbkap@gmail.com Blake Kaplan]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:rbs@maths.uq.edu.au rbs@maths.uq.edu.au]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|source_dirs=parser/htmlparser&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/doc/parser.html&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HAL&lt;br /&gt;
|description=Hardware Abstraction Layer&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands]&lt;br /&gt;
|peers=[mailto:gsvelto@mozilla.com Gabriele Svelto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=hal/&lt;br /&gt;
|components=Core::Hardware Abstraction Layer (HAL)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HTML Parser&lt;br /&gt;
|description=The HTML Parser transforms HTML source code into a DOM. It conforms to the HTML specification, and is mostly translated automatically from Java to C++.&lt;br /&gt;
|owner=[mailto:hsivonen@iki.fi Henri Sivonen]&lt;br /&gt;
|peers=[mailto:wchen@mozilla.com William Chen]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=parser/html&lt;br /&gt;
|url=http://about.validator.nu/&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=I18N Library&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jshin1987@gmail.com Jungshik Shin], [mailto:smontagu@smontagu.org Simon Montagu]&lt;br /&gt;
|peers=[mailto:VYV03354@nifty.ne.jp Masatoshi Kimura]&lt;br /&gt;
|group=dev-i18n&lt;br /&gt;
|source_dirs=intl/&lt;br /&gt;
|url=http://mozilla.org/projects/intl/index.html&lt;br /&gt;
|components=Core::Internationalization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=ImageLib&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:tnikkel@gmail.com Timothy Nikkel]&lt;br /&gt;
|peers=[mailto:aosmond@mozilla.com Andrew Osmond], [mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:seth.bugzilla@blackhail.net Seth Fowler]&lt;br /&gt;
|peersemeritus=[mailto:netzen@gmail.com Brian Bondy], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/libjpeg/, media/libpng/, image/, modules/zlib/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::ImageLib&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IPC&lt;br /&gt;
|description=Message-passing between threads and processes&lt;br /&gt;
|owner=[mailto:wmccloskey@mozilla.com Bill McCloskey]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:kchen@mozilla.com Kan-Ru Chen], [mailto:jld@mozilla.com Jed Davis], [mailto:nfroyd@mozilla.com Nathan Froyd], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:amccreight@mozilla.com Andrew McCreight]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/glue/, ipc/ipdl/, ipc/chromium/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript&lt;br /&gt;
|description=JavaScript engine (SpiderMonkey)&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:jdemooij@mozilla.com Jan de Mooij], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:nnethercote@mozilla.com Nick Nethercote], [mailto:jwalden@mit.edu Jeff Walden], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:evilpies@gmail.com Tom Schuster], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:till@tillschneidereit.net Till Schneidereit], [mailto:efaust@mozilla.com Eric Faust], [mailto:nfitzgerald@mozilla.com Nick Fitzgerald], [mailto:luke@mozilla.com Luke Wagner], [mailto:arai.unmht@gmail.com Tooru Fujisawa], [mailto:sunfish@mozilla.com Dan Gohman], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:nmatsakis@mozilla.com Niko Matsakis], [mailto:ejpbruel@mozilla.com Eddy Bruel], [mailto:danderson@mozilla.com David Anderson], [mailto:igor@mir2.org Igor Bukanov], [mailto:brendan@mozilla.org Brendan Eich], Andreas Gal&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey,&lt;br /&gt;
http://developer.mozilla.org/en/docs/About_JavaScript&lt;br /&gt;
|components=Core::JavaScript Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript JIT&lt;br /&gt;
|description=JavaScript engine&#039;s JIT compilers (IonMonkey, Baseline)&lt;br /&gt;
|owner=[mailto:jdemooij@mozilla.com Jan de Mooij]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:bbouvier@mozilla.com Benjamin Bouvier], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:nicolas.b.pierron@mozilla.com Nicolas Pierron], [mailto:evilpies@gmail.com  Tom Schuster], [mailto:sstangl@mozilla.com Sean Stangl], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:luke@mozilla.com Luke Wagner]&lt;br /&gt;
|group=dev-tech-js-engine-internals&lt;br /&gt;
|source_dirs=js/src/jit&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey&lt;br /&gt;
|components=Core::JavaScript Engine: JIT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript Debugger Backend&lt;br /&gt;
|description=JavaScript debugging hooks&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:rginda@hacksrus.com Rob Ginda]&lt;br /&gt;
|group=dev-apps-js-debugger&lt;br /&gt;
|source_dirs=js/jsd/&lt;br /&gt;
|url=http://www.mozilla.org/js/jsd&lt;br /&gt;
|components=Other Applications::Venkman JS Debugger&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=jsat&lt;br /&gt;
|description=Javascript screen reader that is used in Android and B2G&lt;br /&gt;
|owner=[mailto:eitan@monotonous.org Eitan Isaacson]&lt;br /&gt;
|peers=[mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/jsat/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-ctypes&lt;br /&gt;
|description=A foreign function interface which allows privileged JS code to interact with binary code without using XPCOM/XPConnect.&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src/ctypes/&lt;br /&gt;
|url=https://wiki.mozilla.org/JSctypes&lt;br /&gt;
|components=Core::js-ctypes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-tests&lt;br /&gt;
|description=JavaScript test suite&lt;br /&gt;
|owner=[mailto:bclary@bclary.com Bob Clary]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tests/&lt;br /&gt;
|url=http://www.mozilla.org/js/tests/library.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Layout Engine&lt;br /&gt;
|description=rendering tree construction, layout (reflow), etc.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:bzbarsky@mit.edu Boris Zbarsky],  [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:jfkthame@gmail.com Jonathan Kew], [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:matt.woodrow@gmail.com Matt Woodrow], [mailto:xidorn+moz@upsuper.org Xidorn Quan]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/%, layout/base/, layout/build/, layout/doc/, layout/forms/, layout/generic/, layout/html/, layout/printing/, layout/tables/, layout/tools/&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout, Core::Layout: Block and Inline, Core::Layout: Floats, Core::Layout: Form Controls, Core::Layout: HTML Frames, Core::Layout: Images, Core::Layout: Misc Code, Core::Layout: R &amp;amp; A Pos, Core::Layout: Tables, Core::Layout: Text, Core::Print Preview, Core::Printing: Output&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=libjar&lt;br /&gt;
|description=The JAR handling code (protocol handler, stream implementation, and zipreader/zipwriter).&lt;br /&gt;
|owner=[mailto:mwu@mozilla.com Michael Wu]&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libjar&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MathML&lt;br /&gt;
|description=MathML is a low-level specification for describing mathematics which provides a foundation for the inclusion of mathematical expressions in Web pages.&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-tech-mathml&lt;br /&gt;
|source_dirs=layout/mathml/&lt;br /&gt;
|url=http://www.mozilla.org/projects/mathml/&lt;br /&gt;
|components=Core::MathML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Playback&lt;br /&gt;
|description=HTML Media APIs, including Media Source Extensions and non-MSE video/audio element playback, and Encrypted Media Extensions. (WebRTC and WebAudio not included).&lt;br /&gt;
|owner=[mailto:cpearce@mozilla.com Chris Pearce]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:ajones@mozilla.com Anthony Jones], [mailto:kinetik@flim.org Matthew Gregan], [mailto:eflores@mozilla.com Edwin Flores], [mailto:jyavenard@mozilla.com Jean-Yves Avenard], [mailto:gsquelart@mozilla.com Gerald Squelart], [mailto:rgiles@mozilla.com Ralph Giles], [mailto:jwwang@mozilla.com JW Wang]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=dom/media, media/gmp-clearkey/, media/libcubeb/, media/libnestegg/, media/libogg/, media/libopus/, media/libstagefright/, media/libtheora/, media/libtremor/, media/libvorbis/, media/libvpx/, media/omx-plugin/, media/rlz/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Audio/Video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Transport&lt;br /&gt;
|description=Pluggable transport for real-time media&lt;br /&gt;
|owner=[mailto:ekr@rtfm.com Eric Rescorla]&lt;br /&gt;
|peers=[mailto:bcampen@mozilla.com Byron Campen], [mailto:abr@mozilla.com Adam Roach], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=media/mtransport&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::WebRTC::Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Memory Allocator&lt;br /&gt;
|description=Most things related to memory allocation in Gecko, including jemalloc, replace-malloc, DMD (dark matter detector), logalloc, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:n.nethercote@gmail.com Nicholas Nethercote], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=memory/&lt;br /&gt;
|components=Core::DMD, Core::jemalloc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mfbt&lt;br /&gt;
|description=mfbt is a collection of headers, macros, data structures, methods, and other functionality available for use and reuse throughout all Mozilla code (including SpiderMonkey and Gecko more broadly).&lt;br /&gt;
|owner=[mailto:jwalden@mit.edu Jeff Walden]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:Ms2ger@gmail.com Ms2ger], [mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mfbt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::MFBT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozApps API &amp;amp; UI&lt;br /&gt;
|description=Implementation of the navigator.mozApps API&lt;br /&gt;
|owner=[mailto:fabrice@mozilla.com Fabrice Desré], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:myk@mozilla.org Myk Melez], [mailto:mar.castelluccio@studenti.unina.it Marco Castelluccio], [mailto:ferjmoreno@gmail.com Fernando Jiménez]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/apps/, dom/interfaces/apps, product specific files implementing UI hooks.&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM: Apps&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Mozglue&lt;br /&gt;
|description=Glue library containing various low-level functionality, including a dynamic linker for Android, a DLL block list for Windows, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd] (mozglue/linker), [mailto:kgupta@mozilla.com Kartikaya Gupta] (mozglue/android), [mailto:nchen@mozilla.com Jim Chen] (mozglue/android)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mozglue/&lt;br /&gt;
|components=Core::mozglue&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozilla-toplevel&lt;br /&gt;
|description=The top level directory for the mozilla tree.&lt;br /&gt;
|owner=[mailto:brendan@mozilla.org Brendan Eich]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=tools/README&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MSCOM&lt;br /&gt;
|description=Integration with Microsoft Distributed COM&lt;br /&gt;
|owner=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|peers=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/mscom/%&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC: MSCOM}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Necko&lt;br /&gt;
|description=The Mozilla Networking Library&lt;br /&gt;
|owner=[mailto:mcmanus@ducksong.com Patrick McManus]&lt;br /&gt;
|peers= [mailto:jduell.mcbugs@gmail.com Jason Duell], [mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:mnovotny@mozilla.com Michal Novotny], [mailto:hurley@mozilla.com Nick Hurley], [mailto:dd.mozilla@gmail.com  Dragana Damjanovic ],[mailto:valentin.gosu@gmail.com Valentin Gosu],[mailto:daniel@haxx.se Daniel Stenberg ], [mailto:schien@mozilla.com ShihChiang Chien]&lt;br /&gt;
|peersemeritus= [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sworkman@mozilla.com Steve Workman], [mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=netwerk/%, netwerk/base/, netwerk/build/, netwerk/cache/, netwerk/dns/, netwerk/locales/, netwerk/mime/, netwerk/protocol/, netwerk/resources/, netwerk/socket/, netwerk/streamconv/, netwerk/system/, netwerk/test/, netwerk/testserver/&lt;br /&gt;
|url=http://www.mozilla.org/projects/netlib/, https://developer.mozilla.org/en/Necko&lt;br /&gt;
|components=Core::Networking, Core::Networking: Cache, Core::Networking: Cookies, Core::Networking: FTP, Core::Networking: File, Core::Networking: HTTP, Core::Networking: JAR, Core::Networking: Websockets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=NSPR&lt;br /&gt;
|description=Netscape Portable Runtime&lt;br /&gt;
|owner=[mailto:kaie@kuix.de Kai Engert]&lt;br /&gt;
|peers=[mailto:wtc@google.com Wan-Teh Chang], [mailto:mh@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-tech-nspr&lt;br /&gt;
|source_dirs=nsprpub/&lt;br /&gt;
|url=http://www.mozilla.org/projects/nspr/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/reference/html/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/release-notes/&lt;br /&gt;
|components=NSPR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PDF&lt;br /&gt;
|description=Rendering code to display documents encoded in the ISO 32000-1 `PDF&#039; format.&lt;br /&gt;
|owner=Chris Jones, Andreas Gal&lt;br /&gt;
|peers=[mailto:aadib@mozilla.com Artur Adib], [mailto:bdahl@mozilla.com Brendan Dahl], [mailto:vnicolas@mozilla.com Vivien Nicolas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/pdf/&lt;br /&gt;
|url=https://github.com/mozilla/pdf.js&lt;br /&gt;
|components=Core::PDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Plugins&lt;br /&gt;
|description= NPAPI Plugin support.&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:john@pointysoftware.net John Schoenick], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:jstenback@gmail.com Johnny Stenback], Benjamin Smedberg&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/plugins/, modules/plugin/&lt;br /&gt;
|url=https://wiki.mozilla.org/Plugins&lt;br /&gt;
|components=Core::Plug-ins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Preferences&lt;br /&gt;
|description=Preference library&lt;br /&gt;
|owner=[mailto:nnethercote@mozilla.com Nicholas Nethercote]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:felipe@mozilla.com Felipe Gomes], [mailto:glandium@mozilla.com Mike Hommey], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libpref/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Preferences: Backend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Private Browsing&lt;br /&gt;
|description=Implementation of the Private Browsing mode, and the integration of other modules with Private Browsing APIs.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=Implementation and consumers of Private Browsing APIs in nsILoadContext, nsIPrivateBrowsingChannel, PrivateBrowsingUtils.jsm and the related glue code. &lt;br /&gt;
|url=https://wiki.mozilla.org/Private_Browsing&lt;br /&gt;
|components=Firefox::Private Browsing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Privilege Manager&lt;br /&gt;
|description=&amp;quot;caps&amp;quot;&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peersemeritus=[mailto:brendan@mozilla.org Brendan Eich], [mailto:jstenback@gmail.com Johnny Stenback], [mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=caps/&lt;br /&gt;
|url=http://www.mozilla.org/projects/security/components/index.html&lt;br /&gt;
|components=Core::Security: CAPS&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Push Notifications&lt;br /&gt;
|description=Push is a way for application developers to send messages to their web applications.&lt;br /&gt;
|owners=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:nsm.nikhil@gmail.com Nikhil Marathe], [mailto:kcambridge@mozilla.com Kit Cambridge], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ddamjanovic@mozilla.com Dragana Damjanovic]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/push, dom/simplepush&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PyXPCOM&lt;br /&gt;
|description=The Python to XPCOM bridge.&lt;br /&gt;
|owner=Todd Whiteman&lt;br /&gt;
|peers=[mailto:mhammond@skippinet.com.au Mark Hammond]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=extension/python&lt;br /&gt;
|url=https://developer.mozilla.org/en/PyXPCOM&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=RDF&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:axel@pike.org Axel Hecht]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-rdf&lt;br /&gt;
|source_dirs=rdf/&lt;br /&gt;
|url=http://www.mozilla.org/rdf/doc/&lt;br /&gt;
|components=Core::RDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=security&lt;br /&gt;
|description=Crypto/PKI code, including NSS (Network Security Services) and JSS (NSS for Java)&lt;br /&gt;
|owner=[mailto:rrelyea@redhat.com Bob Relyea], [mailto:ttaubert@mozilla.com Tim Taubert]&lt;br /&gt;
|peers=[mailto:emaldona@redhat.com Elio Maldonado], [mailto:kaie@kuix.de Kai Engert], [mailto:ryan.sleevi@gmail.com Ryan Sleevi], [mailto:ekr@rtfm.com Eric Rescorla], [mailto:franziskuskiefer@gmail.com Franziskus Kiefer], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:wtc@google.com Wan-Teh Chang]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=dbm/, security/coreconf/, security/dbm/, security/jss/, security/nss/, security/tinderbox/, security/tinderlight/&lt;br /&gt;
|url=http://mozilla.org/projects/security/pki/&lt;br /&gt;
|components=NSS, JSS, Core::Security, Core::Security: S/MIME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Security - Mozilla PSM Glue&lt;br /&gt;
|description=Personal Security Manager&lt;br /&gt;
|owner=[mailto:dkeeler@mozilla.com David Keeler]&lt;br /&gt;
|peers=[mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:cykesiopka.bmo@gmail.com Cykesiopka]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=security/manager/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Security: PSM, Core::Security: UI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Static analysis &amp;amp; rewriting for C++&lt;br /&gt;
|description=Tools for checking C++ code looking for problems at compile time, plus tools for automated rewriting of C++ code.&lt;br /&gt;
|owner=[mailto:nika@thelayzells.com Nika Layzell] (while Ehsan is away)&lt;br /&gt;
|peers=[mailto:sfink@mozilla.com Steve Fink], [mailto:jrmuizel@mozilla.com Jeff Muizelaar], [mailto:birunthan@mohanathas.com Birunthan Mohanathas], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=build/clang-plugin, tools/rewriting among other out of tree tools&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Rewriting &amp;amp; Analysis&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=storage&lt;br /&gt;
|description=Storage APIs with a SQLite backend&lt;br /&gt;
|owner=[mailto:mak77@bonardo.net Marco Bonardo]&lt;br /&gt;
|peers=[mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=db/sqlite3/, storage/&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/Storage&lt;br /&gt;
|components=Toolkit::Storage, Core::SQL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=String&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=string/, xpcom/string/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Mozilla_internal_string_guide&lt;br /&gt;
|components=Core::String&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Style System&lt;br /&gt;
|description=CSS style sheet handling; style data computation&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:cam@mcc.id.au Cameron McCormack]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/style/&lt;br /&gt;
|url=https://wiki.mozilla.org/Gecko:Overview#Style_System&lt;br /&gt;
|components=Core::CSS Parsing and Computation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=SVG&lt;br /&gt;
|description=Scalable Vector Graphics&lt;br /&gt;
|owner=[mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|peers=[mailto:longsonr@gmail.com Robert Longson], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:birtles@gmail.com Brian Birtles]&lt;br /&gt;
|group=dev-tech-svg&lt;br /&gt;
|source_dirs=dom/svg/, layout/svg/, dom/smil/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Web/SVG&lt;br /&gt;
|components=Core::SVG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Tamarin&lt;br /&gt;
|description=VM for ActionScript and JavaScript&lt;br /&gt;
|owner=Edwin Smith, [mailto:jodyer@adobe.com Jeff Dyer]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:stejohns@adobe.com Steven Johnson], [mailto:tierney@adobe.com Erik Tierney], [mailto:treilly@adobe.com Tom Reilly]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tamarin&lt;br /&gt;
|url=http://www.mozilla.org/projects/tamarin/&lt;br /&gt;
http://wiki.mozilla.org/tamarin/&lt;br /&gt;
http://hg.mozilla.org/tamarin-central/&lt;br /&gt;
http://hg.mozilla.org/tamarin-tracing/&lt;br /&gt;
|components=Tamarin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Test Harness&lt;br /&gt;
|description=In-tree test infrastructure and tools. Harnesses include, XPCShell, Mochitest (&amp;amp; Chrome), Reftest, JsREftest, Compiled Code Tests, Robocop, Mozmill, Marionette, Firefox UI Tests. Requests for new harnesses should go to Testing::General.&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron] (reftest), [mailto:jwalden@mit.edu Jeff Walden] (httpd.js, jsreftest), Rob Campbell (mochitest, mochitest chrome, marionette), [mailto:jmaher@mozilla.com Joel Maher] (reftest, mochitest, jsreftest), [mailto:ctalbert@mozilla.com Clint Talbert] (reftest, compiled code, mozmill), [mailto:geoffbrown@mozilla.com Geoff Brown] (robocop), [mailto:hskupin@mozilla.com Henrik Skupin] (Marionette, Firefox UI tests), [mailto:ato@mozilla.com Andreas Tolfsen] (marionette), [mailto:jgriffin Jonathan Griffin] (marionette), [mailto:dburns@mozilla.com David Burns] (marionette), [mailto:dminor@mozilla.com Dan Minor], [mailto:mjzffr@gmail.com Maja Frydrychowicz] (Marionette, Firefox UI tests), &lt;br /&gt;
&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=/testing&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::General, Testing::Mochitest, Testing::Mochitest Chrome, Testing::Marionette, Testing::Mozmill, Testing::Reftest, Testing::XPCShell Harness, Testing::httpd.js&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Testing Infrastructure&lt;br /&gt;
|description=Testing tools and infrastructure for Mozilla projects, harnesses for automated tests, stand-alone test tools. Talos, Graph Server, Mozbase, Pulse, WOO, Bughunter, SUTAgent, Eideticker&lt;br /&gt;
|owner=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|peers=[mailto:bclary@bclary.com Bob Clary], [mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:ccooper@deadsquid.com Chris Cooper], [mailto:ctalbert@mozilla.com Clint Talbert], [mailto:robert@roberthelmer.com Robert Helmer], [mailto:jmaher@mozilla.com Joel Maher], Rob Campbell, [mailto:wlach@mozilla.com William Lachance], [mailto:jeads@mozilla.com Jonathan Eads], [mailto:jgriffin Jonathan Griffin], [mailto:bmoss@mozilla.com Bob Moss], [mailto:mcote@mozilla.com Mark Côté]&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=testing/, tools/httptester/, tools/page-loader/, tools/test-harness/, tools/tests/, tools/testserver/, tools/testy/&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::Infrastructure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JS Marionette&lt;br /&gt;
|description=NodeJS test harness, marionette client, and other utilities for running marionette tests (submodule of Test Infrastructure)&lt;br /&gt;
|owner=[mailto:jlal@mozilla.com James Lal] &amp;lt;lightsofapollo&amp;gt;, [mailto:gaye@mozilla.com Gareth Aye] &amp;lt;gaye&amp;gt;&lt;br /&gt;
|peers=[mailto:aus@mozilla.com Ghislain &amp;quot;Aus&amp;quot; Lacroix] &amp;lt;auswerk&amp;gt;&lt;br /&gt;
|source_dirs=gaia/tests/jsmarionette&lt;br /&gt;
|components=Testing::JSMarionette&lt;br /&gt;
|group=dev-gaia&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCShell Test Harness&lt;br /&gt;
|description=The XPCShell Harness&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|source_dirs=testing/xpcshell&lt;br /&gt;
|components=Testing::XPCShell Harness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Update Service&lt;br /&gt;
|description=server code for Mozilla Update services (aus, addons, pfs)&lt;br /&gt;
|owner=Mike Morgan&lt;br /&gt;
|peers=[mailto:jscott@mozilla.com Justin Scott], [mailto:shaver@mozilla.org Mike Shaver], [mailto:wclouser@mozilla.com Will Clouser]&lt;br /&gt;
|group=dev-amo&lt;br /&gt;
|source_dirs=webtools/addons/, webtools/aus/, webtools/update/&lt;br /&gt;
|url=http://wiki.mozilla.org/wiki/AMO&lt;br /&gt;
|components=AUS::Administration, AUS::Systems&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=View System&lt;br /&gt;
|description=The View Manager is responsible for handling &amp;quot;heavyweight&amp;quot; rendering (some clipping, compositing) and event handling tasks.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=view/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Layout: View Rendering&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Audio&lt;br /&gt;
|description=Support for the W3C Web Audio API specification.&lt;br /&gt;
|owner=[mailto:padenot@mozilla.com Paul Adenot]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/media/webaudio&lt;br /&gt;
|url=https://wiki.mozilla.org/Web_Audio_API&lt;br /&gt;
|components=Core::Web Audio&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Painting&lt;br /&gt;
|description=painting, display lists, and layer construction&lt;br /&gt;
|owner=[mailto:matt.woodrow@gmail.com Matt Woodrow]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dbaron@dbaron.org David Baron],   [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs= layout/painting, the display list and layer related methods on nsIFrame and its subclasses&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout: Web Painting&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC&lt;br /&gt;
|description=WebRTC is responsible for realtime audio and video communication, as well as related issues like low-level camera and microphone access&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:bcampen@mozilla.com Byron Campen] [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=netwerk/sctp (also see submodules &amp;quot;WebRTC Media&amp;quot; and &amp;quot;WebRTC Signaling&amp;quot;)&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC, Core::WebRTC Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebVR&lt;br /&gt;
|description=Gecko&#039;s implementation of WebVR (Virtual Reality) functionality, including API, devices, graphics and integration&lt;br /&gt;
|owner=[mailto:kgilbert@mozilla.com Kip Gilbert]&lt;br /&gt;
|peers=[mailto:dmu@mozilla.com Daosheng Mu]&lt;br /&gt;
|peersemeritus=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/vr, gfx/vr&lt;br /&gt;
|url=https://mozvr.com/&lt;br /&gt;
|components=Core::WebVR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peersemeritus=[mailto:pavlov@pavlov.net Stuart Parmenter], &lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/, widget/xpwidgets/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Drag and Drop, Core::Widget, Core::Printing: Setup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Android&lt;br /&gt;
|description=The Android Port&lt;br /&gt;
|owner=[mailto:blassey.bugs@lassey.us Brad Lassey]&lt;br /&gt;
|peers=[mailto:jwillcox@mozilla.com James Willcox]&lt;br /&gt;
|group=dev-platforms-mobile&lt;br /&gt;
|source_dirs=widget/android/, embedding/android&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Android&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - GTK&lt;br /&gt;
|description=supported X widgetry and gfx&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/gtk/, widget/gtk2/, widget/gtksuperwin/, widget/gtkxtbin/&lt;br /&gt;
|url=http://www.mozilla.org/unix/, http://www.gtk.org, http://www.mozilla.org/ports/gtk/&lt;br /&gt;
|components=Core::Widget: Gtk&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - OS X&lt;br /&gt;
|description= Gecko&#039;s OS X compatibility layer.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas], [mailto:bgirard@mozilla.com Benoit Girard], [mailto:spohl@mozilla.com Stephen Pohl], [mailto:smichaud@pobox.com Steven Michaud]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/cocoa/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Cocoa&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Windows&lt;br /&gt;
|description=Windows widgets and desktop integration&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peersemeritus=[mailto:blassey@mozilla.com Brad Lassey], [mailto:netzen@gmail.com Brian Bondy], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:doug.turner@gmail.com Doug Turner], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref], [mailto:robarnold@cmu.edu Rob Arnold]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/windows/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Win32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XBL&lt;br /&gt;
|description=eXtensible Binding Language&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|ownersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=dom/xbl/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xbl/&lt;br /&gt;
|components=Core::XBL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XML&lt;br /&gt;
|description=XML in Mozilla, including XML, XHTML, Namespaces in XML, Associating Style Sheets with XML Documents, XML Linking and XML Extras. XML-related things that are not covered by more specific projects.&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-tech-xml&lt;br /&gt;
|source_dirs=dom/xml/, extensions/xmlextras/, parser/expat/&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/xml/&lt;br /&gt;
|components=Core::XML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPApps&lt;br /&gt;
|description=Cross-Platform Applications, mostly Navigator front end and application shell.&lt;br /&gt;
|owner=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|peers=[mailto:dean_tessman@hotmail.com Dean Tessman], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-apps-seamonkey&lt;br /&gt;
|source_dirs=xpfe/&lt;br /&gt;
|url=http://www.mozilla.org/xpapps/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCOM&lt;br /&gt;
|description=The cross-platform object model and core data structures.&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd]&lt;br /&gt;
|peers=[mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|ownersemeritus=Benjamin Smedberg&lt;br /&gt;
|peersemeritus=[https://mozillians.org/en-US/u/dougt/ Doug Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=startupcache/, xpcom/%, xpcom/base/, xpcom/build/, xpcom/components/, xpcom/ds/, xpcom/glue/, xpcom/proxy/, xpcom/sample/, xpcom/stub/, xpcom/tests/, xpcom/threads/, xpcom/tools/, xpcom/windbgdlg/&lt;br /&gt;
|url=http://developer.mozilla.org/en/XPCOM&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPConnect&lt;br /&gt;
|description=Deep Magic&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:gkrizsanits@mozilla.com Gabor Krizsanits], [mailto:amccreight@mozilla.com Andrew McCreight], [mailto:kmaglione@mozilla.com Kris Maglione]&lt;br /&gt;
|peersemeritus=[mailto:gal@uci.edu Andreas Gal], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=js/xpconnect/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::XPConnect&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPIDL&lt;br /&gt;
|description=Cross-platform IDL compiler; produces .h C++ header files and .xpt runtime type description files from .idl interface description files.&lt;br /&gt;
|owner=[mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|peersemeritus=[mailto:shaver@mozilla.org Mike Shaver], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=xpcom/typelib/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xpidl&lt;br /&gt;
http://www.mozilla.org/scriptable&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPInstall&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-xpinstall&lt;br /&gt;
|source_dirs=xpinstall/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Installer: XPInstall Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPToolkit&lt;br /&gt;
|description=Cross-platform user interface toolkit&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Jan.Varga@gmail.com Jan Varga]&lt;br /&gt;
|group=dev-tech-xul&lt;br /&gt;
|source_dirs=dom/xul/, layout/xul/&lt;br /&gt;
|url=http://www.mozilla.org/xpfe/&lt;br /&gt;
|components=Core::XP Toolkit/Widgets: Menus, Core::XP Toolkit/Widgets: XUL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XSLT Processor&lt;br /&gt;
|description=XSLT transformations processor&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:axel@pike.org Axel Hecht], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xslt&lt;br /&gt;
|source_dirs=dom/xslt/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xslt/, http://www.w3.org/TR/xslt.html&lt;br /&gt;
|components=Core::XSLT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing&lt;br /&gt;
|description=Cross platform sandboxing&lt;br /&gt;
|owner=[mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|peers=[mailto:bowen@mozilla.com Bob Owen], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:gDestuynder@mozilla.com Guillaume Destuynder], [mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Windows &lt;br /&gt;
|description=Sandboxing for the Windows platform &lt;br /&gt;
|owner=[mailto:bowen@mozilla.com Bob Owen]&lt;br /&gt;
|peers=[mailto:netzen@gmail.com Brian Bondy], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:jimm@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/win &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - OSX &lt;br /&gt;
|description=Sandboxing for the OSX platform &lt;br /&gt;
|owner=[mailto:haftandilian@mozilla.com Haik Aftandilian]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox/mac &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing -  Linux &amp;amp; B2G&lt;br /&gt;
|description=Sandboxing for the Linux &amp;amp; B2G platforms&lt;br /&gt;
|owner=[mailto:jhector@mozilla.com Julian Hector]&lt;br /&gt;
|peers=[mailto:jld@mozilla.com Jed Davis] [mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/linux&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Submodules===&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Fennec&lt;br /&gt;
|description=Submodule of the build config covering Fennec&#039;s build system in mobile/android.&lt;br /&gt;
|owner=[mailto:nalexander@mozilla.com Nicholas Alexander]&lt;br /&gt;
|peers=Same as Build Config&lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Media&lt;br /&gt;
|description=Submodule of WebRTC responsible for access to media input devices (microphones, cameras, screen capture), as well as realtime audiovisual codecs and packetization.&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:jib@mozilla.com Jan-Ivar Bruaroey], [mailto:dminor@mozilla.com Dan Minor], [mailto:apehrson@mozilla.com Andreas Pehrson], &lt;br /&gt;
|peersemeritus=[mailto:pkerr@mozilla.com Paul Kerr], [mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc, /dom/media/webrtc, /dom/media/systemservices&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Audio/Video)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Signaling&lt;br /&gt;
|description=Submodule of WebRTC responsible for implementation of PeerConnection API, WebRTC identity, and SDP/JSEP handling&lt;br /&gt;
|owner=[mailto:bcampen@mozilla.com Byron Campen]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:abr@mozilla.com Adam Roach], [mailto:rjesup@mozilla.com Randell Jesup], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc/signaling/&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Signaling)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unassigned Bugzilla Components===&lt;br /&gt;
&lt;br /&gt;
The following Bugzilla components in the Core project have not been assigned to a module (this list is not exhaustive):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Core::File Handling&lt;br /&gt;
Core::Find Backend&lt;br /&gt;
Core::Gecko Profiler&lt;br /&gt;
Core::General&lt;br /&gt;
Core::HTML: Form Submission&lt;br /&gt;
Core::History: Global&lt;br /&gt;
Core::Image Blocking&lt;br /&gt;
Core::JavaScript Debugging APIs&lt;br /&gt;
Core::Localization&lt;br /&gt;
Core::Nanojit&lt;br /&gt;
Core::Networking: Domain Lists&lt;br /&gt;
Core::Print Preview&lt;br /&gt;
Core::Printing: Output&lt;br /&gt;
Core::Printing: Setup&lt;br /&gt;
Core::Profile: BackEnd&lt;br /&gt;
Core::Profile: Migration&lt;br /&gt;
Core::Profile: Roaming&lt;br /&gt;
Core::QuickLaunch (AKA turbo mode)&lt;br /&gt;
Core::Rewriting and Analysis&lt;br /&gt;
Core::Selection&lt;br /&gt;
Core::Serializers&lt;br /&gt;
Core::Spelling checker&lt;br /&gt;
Core::Tracking&lt;br /&gt;
Core::Web Services&lt;br /&gt;
Core::WebDAV&lt;br /&gt;
Core::Widget: OS/2&lt;br /&gt;
Core::Widget: Photon&lt;br /&gt;
Core::X-remote&lt;br /&gt;
Core::XForms&lt;br /&gt;
Core::XUL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1172226</id>
		<title>Modules/Core</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1172226"/>
		<updated>2017-05-30T23:58:16Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Only module owners may edit this page.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
They may:&lt;br /&gt;
&lt;br /&gt;
* update any information about their module except the name of the owner&lt;br /&gt;
* add or remove sub-modules&lt;br /&gt;
* change the owner of a sub-module &lt;br /&gt;
* add emeritus owners or peers&lt;br /&gt;
&lt;br /&gt;
Other changes, including changes of module owner or addition/removal of modules, must be agreed with the Module Ownership Module group, probably via a discussion in [https://www.mozilla.org/about/forums/#governance mozilla.governance].&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Accessibility&lt;br /&gt;
|description=Support for platform accessibility APIs. Accessibility APIs are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and UI controls, as well as important events like changes of focus.&lt;br /&gt;
|owner=[mailto:surkov.alexander@gmail.com Alexander Surkov]&lt;br /&gt;
|peers=[mailto:dbolter@mozilla.com David Bolter], [mailto:eitan@monotonous.org Eitan Isaacson],[mailto:tbsaunde+mozbugs@tbsaunde.org Trevor Saunders],  [mailto:mzehe@mozilla.com Marco Zehe], [mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|ownersemeritus=[mailto:aaron@moonset.net. Aaron Leventhal]&lt;br /&gt;
|peersemeritus=[mailto:ginn.chen@oracle.com Ginn Chen], Evan Yan&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Browser WebAPI&lt;br /&gt;
|description=Web API for rendering apps, browser windows and widgets.&lt;br /&gt;
|owner=[mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:fabrice@mozilla.com Fabrice Desré]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/browser-element/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build and Release Tools&lt;br /&gt;
|description=Tools related to build and release automation and configuration of release builds.&lt;br /&gt;
|owner=[mailto:nthomas@mozilla.com Nick Thomas]&lt;br /&gt;
|peers=[mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:coop@mozilla.com Chris Cooper]&lt;br /&gt;
|group=release-engineering&lt;br /&gt;
|source_dirs=browser/config/mozconfigs/, mobile/android/config/mozconfigs/, xulrunner/config/mozconfigs/, b2g/config/, tools/update-packaging/&lt;br /&gt;
|url=https://wiki.mozilla.org/ReleaseEngineering&lt;br /&gt;
|components=Release Engineering::*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config&lt;br /&gt;
|description=The build system for Gecko and several mozilla.org hosted Gecko-based applications.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc] (:gps)&lt;br /&gt;
|peers=[mailto:mh@glandium.org Mike Hommey] (:glandium), [mailto:mshal@mozilla.com Mike Shal] (:mshal), [mailto:ted@mielczarek.org Ted Mielczarek] (:ted), [mailto:cmanchester@mozilla.com Chris Manchester](:chmanchester), [mailto:nfroyd@mozilla.com Nathan Froyd] (:froydnj), [mailto:rgiles@mozilla.com Ralph Giles] (:rillian)&lt;br /&gt;
|ownersemeritus=Ted Mielczarek (2008-[https://blog.mozilla.org/ted/2013/03/07/gregory-szorc-is-now-the-build-config-module-owner/ 2013]), Benjamin Smedberg (???-[http://benjamin.smedbergs.us/blog/2008-04-30/more-changing-of-the-guard-ted-mielczarek/ 2008]), &lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|source_dirs=build/, config/, python/mozbuild, tools/cross-commit, tools/cvs2hg-import.py, tools/cvsmgmt/, tools/elf-dynstr-gc/, tools/trees.pl, browser/config/mozconfigs/, mobile/config/mozconfigs/, xulrunner/config/mozconfigs/&lt;br /&gt;
|url=http://www.mozilla.org/build/&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Code Analysis and Debugging Tools&lt;br /&gt;
|description=Tools for debugging Mozilla code or for analyzing speed, memory use, and other characteristics of it.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-performance&lt;br /&gt;
|source_dirs=tools/codesighs/, tools/debug/, tools/dreftool/, tools/dumpdeps/, tools/footprint/, tools/jprof/, tools/leaky/, tools/memory/, tools/module-deps/, tools/performance/, tools/post_compile/, tools/preloader/, tools/rb/, tools/reorder/, tools/trace-malloc/, tools/uuiddeps/, &lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content HTTP Headers&lt;br /&gt;
|description=HTTP headers related to content, e.g. User-Agent, Content-Type, Accept. (Transport-related headers are the responsibility of the Necko module owner.)&lt;br /&gt;
|owner=[mailto:gerv@mozilla.org Gervase Markham]&lt;br /&gt;
|peers=[mailto:lmandel@mozilla.com Lawrence Mandel]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs= &lt;br /&gt;
|url=https://developer.mozilla.org/en/Gecko_user_agent_string_reference&lt;br /&gt;
|components=Core::Networking: HTTP&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content Security&lt;br /&gt;
|description=Native content-based security features, including: Content Security Policy (CSP), Mixed Content Blocker (MCB), Subresource Integrity (SRI) and CORS.&lt;br /&gt;
|owner=[mailto:ckerschbaumer@mozilla.com Christoph Kerschbaumer]&lt;br /&gt;
|peers=[mailto:francois@mozilla.com François Marier], [mailto:jonas@sicking.cc Jonas Sicking],  [mailto:tvyas@mozilla.com Tanvi Vyas], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:mozilla@sidstamm.com Sid Stamm] &lt;br /&gt;
|group=dev-security&lt;br /&gt;
|source_dirs=dom/security&lt;br /&gt;
|components=Core::DOM: Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cookies and Permissions&lt;br /&gt;
|description=&lt;br /&gt;
|owner=Monica Chew&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.com Josh Matthews], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:mconnor@steelgryphon.com Mike Connor], [mailto:dwitte@gmail.com Dan Witte], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sdwilsh@shawnwilsher.com Shawn Wilsher (ping on irc)]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=extensions/cookie/, netwerk/cookie/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Networking: Cookies&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cycle Collector&lt;br /&gt;
|description=Code to break and collect objects within reference cycles&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/mccr8/ Andrew McCreight]&lt;br /&gt;
|peers=Peter Van der Beken, Olli Pettay, David Baron&lt;br /&gt;
|source_dirs=xpcom/base/nsCycleCollector.* and some support headers&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=C++/Rust usage, tools, and style&lt;br /&gt;
|description=Aspects of C++ use such as language feature usage, standard library versions/usage, compiler/toolchain versions, formatting and naming style, and aspects of Rust use as needs arise&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:nfroyd@mozilla.com Nathan Froyd], [mailto:glandium@mozilla.com Mike Hommey], [mailto:jwalden@mozilla.com Jeff Walden]&lt;br /&gt;
|source_dirs=non-third-party C++ and Rust code in the tree&lt;br /&gt;
|components=Various components&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=docshell&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=docshell/, uriloader/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Document Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Device Storage&lt;br /&gt;
|description=Support for the device storage API&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands] (:dhylands), [mailto:jvarga@mozilla.com Jan Varga] (:janv)&lt;br /&gt;
|peers=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner] (:dougt)&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/devicestorage/, dom/interfaces/devicestorage/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/WebAPI/Device_Storage&lt;br /&gt;
|components=Core::DOM: Device Interfaces&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Document Object Model&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:bent.mozilla@gmail.com Ben Turner], [mailto:mounir@lamouri.fr Mounir Lamouri (still active, but slower to respond than previously)], [mailto:me@kylehuey.com Kyle Huey], [mailto:hsivonen@iki.fi Henri Sivonen], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:baku@mozilla.com Andrea Marchesini],&lt;br /&gt;
[mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:bkelly@mozilla.com Ben Kelly], [mailto:billm@mozilla.com Bill McCloskey], [mailto:kyle@nonpolynomial.com Kyle Machulis]&lt;br /&gt;
|ownersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|peersemeritus=[mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/*, except directories covered by other modules&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM, Core::DOM: CSS Object Model, Core::DOM: Core &amp;amp; HTML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=DOM File&lt;br /&gt;
|description=DOM Blob, File and FileSystem APIs &lt;br /&gt;
|owner=[mailto:amarchesini@Mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:olli@pettay.fi Olli Pettay]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/file, dom/filesystem&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Event Handling&lt;br /&gt;
|description=DOM Events and Event Handling &lt;br /&gt;
|owner=[mailto:olli@pettay.fi Olli Pettay], [mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/events and event handling related code elsewhere &lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: Events, Core::Event Handling&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Workers&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:baku@mozilla.com Andrea Marchesini]&lt;br /&gt;
|peers=[mailto:mrbkap@mozilla.com Blake Kaplan], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey], [mailto:bkelly@mozilla.com Ben Kelly]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/workers/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_web_workers&lt;br /&gt;
|components=Core::DOM: Workers&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IndexedDB&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|peers=[mailto:btseng@mozilla.com Bevis Tseng]&lt;br /&gt;
|ownersemeritus=[mailto:bent.mozilla@gmail.com Ben Turner]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/indexedDB/&lt;br /&gt;
|url=https://developer.mozilla.org/en/IndexedDB&lt;br /&gt;
|components=Core::DOM: IndexedDB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Editor&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|peers=[mailto:ayg@aryeh.name Aryeh Gregor]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=editor/&lt;br /&gt;
|url=http://www.mozilla.org/editor/&lt;br /&gt;
|components=Core::Editor&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Embedding&lt;br /&gt;
|description=Gecko embedding APIs and frameworks&lt;br /&gt;
|owner=[mailto:myk@mykzilla.org Myk Melez]&lt;br /&gt;
|ownersemeritus=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:bdahl@mozilla.com Brendan Dahl], [mailto:tbsaunde@tbsaunde.org Trevor Saunders]&lt;br /&gt;
|peersemeritus=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=embedding/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Find As You Type&lt;br /&gt;
|description=Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). Currently seeks new owner.&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=extensions/typeaheadfind/&lt;br /&gt;
|url=http://www.mozilla.org/access/type-ahead/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Gecko Profiler&lt;br /&gt;
|description=Gecko&#039;s built-in profiler&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:nnethercote@mozilla.com Nicholas Nethercote], [mailto:jseward@mozilla.com Julian Seward] (LUL), [mailto:kvijayan@mozilla.com Kannan Vijayan] (JS integration), [mailto:shu@mozilla.com Shu-yu Guo] (JS integration), [mailto:tlee@mozilla.com Thinker Lee] (TaskTracer), [mailto:cyu@mozilla.com Cervantes Yu] (TaskTracer), [mailto:b56girard@gmail.com Benoit Girard].&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=tools/profiler/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler&lt;br /&gt;
|components=Core::Gecko Profiler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Geolocation&lt;br /&gt;
|description=Implementation of the Geolocation W3C Spec, location provider apis, and wifi scanning code.&lt;br /&gt;
|owner=[mailto:josh@joshmatthews.net Josh Matthews], [mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner], Garvan Keeley&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/geolocation, dom/system/, netwerk/wifi&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_geolocation&lt;br /&gt;
|components=Core::Geolocation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Global Key Bindings&lt;br /&gt;
|description=Global hot keys in Mozilla for the browser, editor, mail-news and widgets. Does not include underlined menu accelerators and the like, as those are part of i18n.&lt;br /&gt;
|owner=Aaron Leventhal&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=dom/xbl/builtin/&lt;br /&gt;
|url=http://www.mozilla.org/projects/ui/accessibility/mozkeyintro.html&lt;br /&gt;
|components=Core::Keyboard: Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Graphics&lt;br /&gt;
|description=Mozilla graphics API&lt;br /&gt;
|owner=[mailto:jrmuizel@mozilla.com Jeff Muizelaar](Thebes, QCMS, YCbCr, Cairo/Pixman, Regions, OS X, Other)&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:jdrew@mozilla.com Joe Drew], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:bas.schouten@live.nl Bas Schouten](Layers, Windows), [mailto:bjacob@mozilla.com Benoit Jacob](gfx/gl), [mailto:bgirard@mozilla.com Benoit Girard](Compositor, Performance), [mailto:ajuma.bugzilla@alijuma.com Ali Juma], [mailto:jgilbert@mozilla.com Jeff Gilbert](WebGL, ANGLE), [mailto:george@mozilla.com George Wright](Canvas2D, Skia), [mailto:mwoodrow@mozilla.com Matt Woodrow](Layers API), [mailto:jdaggett@mozilla.com John Daggett](text/fonts), [mailto:jfkthame@googlemail.com Jonathan Kew](text/fonts), [mailto:nsilva@mozilla.com  Nicolas Silva](MozSurface), [mailto:ncameron@mozilla.com Nick Cameron], [mailto:sikeda@mozilla.com Sotaro Ikeda](B2G), [mailto:snorp@mozilla.com James Willcox](Android), [mailto:clord@mozilla.com Christopher Lord], [mailto:mstange@themasta.com Markus Stange](OS X), [mailto:lsalzman@mozilla.com Lee Salzman], [mailto:mchang@mozilla.com Mason Chang], [mailto:dvander@mozilla.com David Anderson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=gfx/, dom/canvas/&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX https://wiki.mozilla.org/Gecko:Layers https://wiki.mozilla.org/Gecko:2DGraphicsSketch&lt;br /&gt;
|components=Core::Graphics, Core::Graphics: Layers, Core::Graphics: Text, Core::GFX: Color Management, Core::Canvas: 2D, Core::Canvas: WebGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=APZ (Graphics submodule)&lt;br /&gt;
|description=Asynchronous panning and zooming&lt;br /&gt;
|owner=[mailto:kgupta@mozilla.com Kartikaya Gupta]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:tnikkel@mozilla.com Timothy Nikkel], [mailto:dvander@mozilla.com David Anderson], [mailto:mstange@mozilla.com Markus Stange]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/layers/apz&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/APZ&lt;br /&gt;
|components=Core::Panning and Zooming&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Moz2D (Graphics submodule)&lt;br /&gt;
|description=Platform independent 2D graphics API&lt;br /&gt;
|owner=[mailto:bschouten@mozilla.com Bas Schouten]&lt;br /&gt;
|peers=[mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:gwright@mozilla.com George Wright], [mailto:jwatt@mozilla.com Jonathan Watt]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/2d&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/Moz2D&lt;br /&gt;
|components=Core::Graphics&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Legacy HTML Parser&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:mrbkap@gmail.com Blake Kaplan]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:rbs@maths.uq.edu.au rbs@maths.uq.edu.au]&lt;br /&gt;
|peersemeritus=[mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|source_dirs=parser/htmlparser&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/doc/parser.html&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HAL&lt;br /&gt;
|description=Hardware Abstraction Layer&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands]&lt;br /&gt;
|peers=[mailto:gsvelto@mozilla.com Gabriele Svelto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=hal/&lt;br /&gt;
|components=Core::Hardware Abstraction Layer (HAL)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HTML Parser&lt;br /&gt;
|description=The HTML Parser transforms HTML source code into a DOM. It conforms to the HTML specification, and is mostly translated automatically from Java to C++.&lt;br /&gt;
|owner=[mailto:hsivonen@iki.fi Henri Sivonen]&lt;br /&gt;
|peers=[mailto:wchen@mozilla.com William Chen]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=parser/html&lt;br /&gt;
|url=http://about.validator.nu/&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=I18N Library&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jshin1987@gmail.com Jungshik Shin], [mailto:smontagu@smontagu.org Simon Montagu]&lt;br /&gt;
|peers=[mailto:VYV03354@nifty.ne.jp Masatoshi Kimura]&lt;br /&gt;
|group=dev-i18n&lt;br /&gt;
|source_dirs=intl/&lt;br /&gt;
|url=http://mozilla.org/projects/intl/index.html&lt;br /&gt;
|components=Core::Internationalization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=ImageLib&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:tnikkel@gmail.com Timothy Nikkel]&lt;br /&gt;
|peers=[mailto:aosmond@mozilla.com Andrew Osmond], [mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:seth.bugzilla@blackhail.net Seth Fowler]&lt;br /&gt;
|peersemeritus=[mailto:netzen@gmail.com Brian Bondy], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/libjpeg/, media/libpng/, image/, modules/zlib/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::ImageLib&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IPC&lt;br /&gt;
|description=Message-passing between threads and processes&lt;br /&gt;
|owner=[mailto:wmccloskey@mozilla.com Bill McCloskey]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:jld@mozilla.com Jed Davis], [mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/glue/, ipc/ipdl/, ipc/chromium/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript&lt;br /&gt;
|description=JavaScript engine (SpiderMonkey)&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:jdemooij@mozilla.com Jan de Mooij], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:nnethercote@mozilla.com Nick Nethercote], [mailto:jwalden@mit.edu Jeff Walden], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:evilpies@gmail.com Tom Schuster], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:till@tillschneidereit.net Till Schneidereit], [mailto:efaust@mozilla.com Eric Faust], [mailto:nfitzgerald@mozilla.com Nick Fitzgerald], [mailto:luke@mozilla.com Luke Wagner], [mailto:arai.unmht@gmail.com Tooru Fujisawa], [mailto:sunfish@mozilla.com Dan Gohman], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:nmatsakis@mozilla.com Niko Matsakis], [mailto:ejpbruel@mozilla.com Eddy Bruel], [mailto:danderson@mozilla.com David Anderson], [mailto:igor@mir2.org Igor Bukanov], [mailto:brendan@mozilla.org Brendan Eich], Andreas Gal&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey,&lt;br /&gt;
http://developer.mozilla.org/en/docs/About_JavaScript&lt;br /&gt;
|components=Core::JavaScript Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript JIT&lt;br /&gt;
|description=JavaScript engine&#039;s JIT compilers (IonMonkey, Baseline)&lt;br /&gt;
|owner=[mailto:jdemooij@mozilla.com Jan de Mooij]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:bbouvier@mozilla.com Benjamin Bouvier], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:nicolas.b.pierron@mozilla.com Nicolas Pierron], [mailto:evilpies@gmail.com  Tom Schuster], [mailto:sstangl@mozilla.com Sean Stangl], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:luke@mozilla.com Luke Wagner]&lt;br /&gt;
|group=dev-tech-js-engine-internals&lt;br /&gt;
|source_dirs=js/src/jit&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey&lt;br /&gt;
|components=Core::JavaScript Engine: JIT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript Debugger Backend&lt;br /&gt;
|description=JavaScript debugging hooks&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:rginda@hacksrus.com Rob Ginda]&lt;br /&gt;
|group=dev-apps-js-debugger&lt;br /&gt;
|source_dirs=js/jsd/&lt;br /&gt;
|url=http://www.mozilla.org/js/jsd&lt;br /&gt;
|components=Other Applications::Venkman JS Debugger&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=jsat&lt;br /&gt;
|description=Javascript screen reader that is used in Android and B2G&lt;br /&gt;
|owner=[mailto:eitan@monotonous.org Eitan Isaacson]&lt;br /&gt;
|peers=[mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/jsat/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-ctypes&lt;br /&gt;
|description=A foreign function interface which allows privileged JS code to interact with binary code without using XPCOM/XPConnect.&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src/ctypes/&lt;br /&gt;
|url=https://wiki.mozilla.org/JSctypes&lt;br /&gt;
|components=Core::js-ctypes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-tests&lt;br /&gt;
|description=JavaScript test suite&lt;br /&gt;
|owner=[mailto:bclary@bclary.com Bob Clary]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tests/&lt;br /&gt;
|url=http://www.mozilla.org/js/tests/library.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Layout Engine&lt;br /&gt;
|description=rendering tree construction, layout (reflow), etc.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:bzbarsky@mit.edu Boris Zbarsky],  [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:jfkthame@gmail.com Jonathan Kew], [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:matt.woodrow@gmail.com Matt Woodrow], [mailto:xidorn+moz@upsuper.org Xidorn Quan]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/%, layout/base/, layout/build/, layout/doc/, layout/forms/, layout/generic/, layout/html/, layout/printing/, layout/tables/, layout/tools/&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout, Core::Layout: Block and Inline, Core::Layout: Floats, Core::Layout: Form Controls, Core::Layout: HTML Frames, Core::Layout: Images, Core::Layout: Misc Code, Core::Layout: R &amp;amp; A Pos, Core::Layout: Tables, Core::Layout: Text, Core::Print Preview, Core::Printing: Output&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=libjar&lt;br /&gt;
|description=The JAR handling code (protocol handler, stream implementation, and zipreader/zipwriter).&lt;br /&gt;
|owner=[mailto:mwu@mozilla.com Michael Wu]&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libjar&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MathML&lt;br /&gt;
|description=MathML is a low-level specification for describing mathematics which provides a foundation for the inclusion of mathematical expressions in Web pages.&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-tech-mathml&lt;br /&gt;
|source_dirs=layout/mathml/&lt;br /&gt;
|url=http://www.mozilla.org/projects/mathml/&lt;br /&gt;
|components=Core::MathML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Playback&lt;br /&gt;
|description=HTML Media APIs, including Media Source Extensions and non-MSE video/audio element playback, and Encrypted Media Extensions. (WebRTC and WebAudio not included).&lt;br /&gt;
|owner=[mailto:cpearce@mozilla.com Chris Pearce]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:ajones@mozilla.com Anthony Jones], [mailto:kinetik@flim.org Matthew Gregan], [mailto:eflores@mozilla.com Edwin Flores], [mailto:jyavenard@mozilla.com Jean-Yves Avenard], [mailto:gsquelart@mozilla.com Gerald Squelart], [mailto:rgiles@mozilla.com Ralph Giles], [mailto:jwwang@mozilla.com JW Wang]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=dom/media, media/gmp-clearkey/, media/libcubeb/, media/libnestegg/, media/libogg/, media/libopus/, media/libstagefright/, media/libtheora/, media/libtremor/, media/libvorbis/, media/libvpx/, media/omx-plugin/, media/rlz/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Audio/Video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Transport&lt;br /&gt;
|description=Pluggable transport for real-time media&lt;br /&gt;
|owner=[mailto:ekr@rtfm.com Eric Rescorla]&lt;br /&gt;
|peers=[mailto:bcampen@mozilla.com Byron Campen], [mailto:abr@mozilla.com Adam Roach], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=media/mtransport&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::WebRTC::Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Memory Allocator&lt;br /&gt;
|description=Most things related to memory allocation in Gecko, including jemalloc, replace-malloc, DMD (dark matter detector), logalloc, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:n.nethercote@gmail.com Nicholas Nethercote], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=memory/&lt;br /&gt;
|components=Core::DMD, Core::jemalloc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mfbt&lt;br /&gt;
|description=mfbt is a collection of headers, macros, data structures, methods, and other functionality available for use and reuse throughout all Mozilla code (including SpiderMonkey and Gecko more broadly).&lt;br /&gt;
|owner=[mailto:jwalden@mit.edu Jeff Walden]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:Ms2ger@gmail.com Ms2ger], [mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mfbt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::MFBT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozApps API &amp;amp; UI&lt;br /&gt;
|description=Implementation of the navigator.mozApps API&lt;br /&gt;
|owner=[mailto:fabrice@mozilla.com Fabrice Desré], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:myk@mozilla.org Myk Melez], [mailto:mar.castelluccio@studenti.unina.it Marco Castelluccio], [mailto:ferjmoreno@gmail.com Fernando Jiménez]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/apps/, dom/interfaces/apps, product specific files implementing UI hooks.&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM: Apps&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Mozglue&lt;br /&gt;
|description=Glue library containing various low-level functionality, including a dynamic linker for Android, a DLL block list for Windows, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd] (mozglue/linker), [mailto:kgupta@mozilla.com Kartikaya Gupta] (mozglue/android), [mailto:nchen@mozilla.com Jim Chen] (mozglue/android)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mozglue/&lt;br /&gt;
|components=Core::mozglue&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozilla-toplevel&lt;br /&gt;
|description=The top level directory for the mozilla tree.&lt;br /&gt;
|owner=[mailto:brendan@mozilla.org Brendan Eich]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=tools/README&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Necko&lt;br /&gt;
|description=The Mozilla Networking Library&lt;br /&gt;
|owner=[mailto:mcmanus@ducksong.com Patrick McManus]&lt;br /&gt;
|peers= [mailto:jduell.mcbugs@gmail.com Jason Duell], [mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:mnovotny@mozilla.com Michal Novotny], [mailto:hurley@mozilla.com Nick Hurley], [mailto:dd.mozilla@gmail.com  Dragana Damjanovic ],[mailto:valentin.gosu@gmail.com Valentin Gosu],[mailto:daniel@haxx.se Daniel Stenberg ]&lt;br /&gt;
|peersemeritus= [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sworkman@mozilla.com Steve Workman], [mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=netwerk/%, netwerk/base/, netwerk/build/, netwerk/cache/, netwerk/dns/, netwerk/locales/, netwerk/mime/, netwerk/protocol/, netwerk/resources/, netwerk/socket/, netwerk/streamconv/, netwerk/system/, netwerk/test/, netwerk/testserver/&lt;br /&gt;
|url=http://www.mozilla.org/projects/netlib/, https://developer.mozilla.org/en/Necko&lt;br /&gt;
|components=Core::Networking, Core::Networking: Cache, Core::Networking: Cookies, Core::Networking: FTP, Core::Networking: File, Core::Networking: HTTP, Core::Networking: JAR, Core::Networking: Websockets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=NSPR&lt;br /&gt;
|description=Netscape Portable Runtime&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:wtc@google.com Wan-Teh Chang], [mailto:mh@glandium.org Mike Hommey], [mailto:kaie@kuix.de Kai Engert]&lt;br /&gt;
|group=dev-tech-nspr&lt;br /&gt;
|source_dirs=nsprpub/&lt;br /&gt;
|url=http://www.mozilla.org/projects/nspr/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/reference/html/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/release-notes/&lt;br /&gt;
|components=NSPR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PDF&lt;br /&gt;
|description=Rendering code to display documents encoded in the ISO 32000-1 `PDF&#039; format.&lt;br /&gt;
|owner=Chris Jones, Andreas Gal&lt;br /&gt;
|peers=[mailto:aadib@mozilla.com Artur Adib], [mailto:bdahl@mozilla.com Brendan Dahl], [mailto:vnicolas@mozilla.com Vivien Nicolas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/pdf/&lt;br /&gt;
|url=https://github.com/mozilla/pdf.js&lt;br /&gt;
|components=Core::PDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Plugins&lt;br /&gt;
|description= NPAPI Plugin support.&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:john@pointysoftware.net John Schoenick], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/plugins/, modules/plugin/&lt;br /&gt;
|url=https://wiki.mozilla.org/Plugins&lt;br /&gt;
|components=Core::Plug-ins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Preferences&lt;br /&gt;
|description=Preference library&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libpref/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Preferences: Backend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Private Browsing&lt;br /&gt;
|description=Implementation of the Private Browsing mode, and the integration of other modules with Private Browsing APIs.&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.net Josh Matthews]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=Implementation and consumers of Private Browsing APIs in nsILoadContext, nsIPrivateBrowsingChannel, PrivateBrowsingUtils.jsm and the related glue code. &lt;br /&gt;
|url=https://wiki.mozilla.org/Private_Browsing&lt;br /&gt;
|components=Firefox::Private Browsing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Privilege Manager&lt;br /&gt;
|description=&amp;quot;caps&amp;quot;&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peersemeritus=[mailto:brendan@mozilla.org Brendan Eich], [mailto:jstenback@gmail.com Johnny Stenback], [mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=caps/&lt;br /&gt;
|url=http://www.mozilla.org/projects/security/components/index.html&lt;br /&gt;
|components=Core::Security: CAPS&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Push Notifications&lt;br /&gt;
|description=Push is a way for application developers to send messages to their web applications.&lt;br /&gt;
|owners=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:nsm.nikhil@gmail.com Nikhil Marathe], [mailto:kcambridge@mozilla.com Kit Cambridge], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ddamjanovic@mozilla.com Dragana Damjanovic]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/push, dom/simplepush&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PyXPCOM&lt;br /&gt;
|description=The Python to XPCOM bridge.&lt;br /&gt;
|owner=Todd Whiteman&lt;br /&gt;
|peers=[mailto:mhammond@skippinet.com.au Mark Hammond]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=extension/python&lt;br /&gt;
|url=https://developer.mozilla.org/en/PyXPCOM&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=RDF&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:axel@pike.org Axel Hecht]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-rdf&lt;br /&gt;
|source_dirs=rdf/&lt;br /&gt;
|url=http://www.mozilla.org/rdf/doc/&lt;br /&gt;
|components=Core::RDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=security&lt;br /&gt;
|description=Crypto/PKI code, including NSS (Network Security Services) and JSS (NSS for Java)&lt;br /&gt;
|owner=[mailto:rrelyea@redhat.com Bob Relyea], [mailto:ttaubert@mozilla.com Tim Taubert]&lt;br /&gt;
|peers=[mailto:emaldona@redhat.com Elio Maldonado], [mailto:kaie@kuix.de Kai Engert], [mailto:ryan.sleevi@gmail.com Ryan Sleevi], [mailto:ekr@rtfm.com Eric Rescorla], [mailto:franziskuskiefer@gmail.com Franziskus Kiefer], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:wtc@google.com Wan-Teh Chang]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=dbm/, security/coreconf/, security/dbm/, security/jss/, security/nss/, security/tinderbox/, security/tinderlight/&lt;br /&gt;
|url=http://mozilla.org/projects/security/pki/&lt;br /&gt;
|components=NSS, JSS, Core::Security, Core::Security: S/MIME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Security - Mozilla PSM Glue&lt;br /&gt;
|description=Personal Security Manager&lt;br /&gt;
|owner=[mailto:dkeeler@mozilla.com David Keeler]&lt;br /&gt;
|peers=[mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:cykesiopka.bmo@gmail.com Cykesiopka]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=security/manager/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Security: PSM, Core::Security: UI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Static analysis &amp;amp; rewriting for C++&lt;br /&gt;
|description=Tools for checking C++ code looking for problems at compile time, plus tools for automated rewriting of C++ code.&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:sfink@mozilla.com Steve Fink], [mailto:michael@thelayzells.com Michael Layzell], [mailto:jrmuizel@mozilla.com Jeff Muizelaar], [mailto:birunthan@mohanathas.com Birunthan Mohanathas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=build/clang-plugin, tools/rewriting among other out of tree tools&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Rewriting &amp;amp; Analysis&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=storage&lt;br /&gt;
|description=Storage APIs with a SQLite backend&lt;br /&gt;
|owner=[mailto:mak77@bonardo.net Marco Bonardo]&lt;br /&gt;
|peers=[mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=db/sqlite3/, storage/&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/Storage&lt;br /&gt;
|components=Toolkit::Storage, Core::SQL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=String&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:jlebar@mozilla.com Justin Lebar]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=string/, xpcom/string/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Mozilla_internal_string_guide&lt;br /&gt;
|components=Core::String&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Style System&lt;br /&gt;
|description=CSS style sheet handling; style data computation&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:cam@mcc.id.au Cameron McCormack]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/style/&lt;br /&gt;
|url=https://wiki.mozilla.org/Gecko:Overview#Style_System&lt;br /&gt;
|components=Core::CSS Parsing and Computation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=SVG&lt;br /&gt;
|description=Scalable Vector Graphics&lt;br /&gt;
|owner=[mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|peers=[mailto:longsonr@gmail.com Robert Longson], [mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:birtles@gmail.com Brian Birtles]&lt;br /&gt;
|group=dev-tech-svg&lt;br /&gt;
|source_dirs=dom/svg/, layout/svg/, dom/smil/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Web/SVG&lt;br /&gt;
|components=Core::SVG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Tamarin&lt;br /&gt;
|description=VM for ActionScript and JavaScript&lt;br /&gt;
|owner=Edwin Smith, [mailto:jodyer@adobe.com Jeff Dyer]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:stejohns@adobe.com Steven Johnson], [mailto:tierney@adobe.com Erik Tierney], [mailto:treilly@adobe.com Tom Reilly]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tamarin&lt;br /&gt;
|url=http://www.mozilla.org/projects/tamarin/&lt;br /&gt;
http://wiki.mozilla.org/tamarin/&lt;br /&gt;
http://hg.mozilla.org/tamarin-central/&lt;br /&gt;
http://hg.mozilla.org/tamarin-tracing/&lt;br /&gt;
|components=Tamarin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Test Harness&lt;br /&gt;
|description=In-tree test infrastructure and tools. Harnesses include, XPCShell, Mochitest (&amp;amp; Chrome), Reftest, JsREftest, Compiled Code Tests, Robocop, Mozmill, Marionette, Firefox UI Tests. Requests for new harnesses should go to Testing::General.&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron] (reftest), [mailto:jwalden@mit.edu Jeff Walden] (httpd.js, jsreftest), Rob Campbell (mochitest, mochitest chrome, marionette), [mailto:jmaher@mozilla.com Joel Maher] (reftest, mochitest, jsreftest), [mailto:ctalbert@mozilla.com Clint Talbert] (reftest, compiled code, mozmill), [mailto:geoffbrown@mozilla.com Geoff Brown] (robocop), [mailto:hskupin@mozilla.com Henrik Skupin] (Marionette, Firefox UI tests), [mailto:ato@mozilla.com Andreas Tolfsen] (marionette), [mailto:jgriffin Jonathan Griffin] (marionette), [mailto:dburns@mozilla.com David Burns] (marionette) [mailto:dminor@mozilla.com Dan Minor], [mailto:mjzffr@gmail.com Maja Frydrychowicz] (Marionette, Firefox UI tests), &lt;br /&gt;
&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=/testing&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::General, Testing::Mochitest, Testing::Mochitest Chrome, Testing::Marionette, Testing::Mozmill, Testing::Reftest, Testing::XPCShell Harness, Testing::httpd.js&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Testing Infrastructure&lt;br /&gt;
|description=Testing tools and infrastructure for Mozilla projects, harnesses for automated tests, stand-alone test tools. Talos, Graph Server, Mozbase, Pulse, WOO, Bughunter, SUTAgent, Eideticker&lt;br /&gt;
|owner=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|peers=[mailto:bclary@bclary.com Bob Clary], [mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:ccooper@deadsquid.com Chris Cooper], [mailto:ctalbert@mozilla.com Clint Talbert], [mailto:robert@roberthelmer.com Robert Helmer], [mailto:jmaher@mozilla.com Joel Maher], Rob Campbell, [mailto:wlach@mozilla.com William Lachance], [mailto:jeads@mozilla.com Jonathan Eads], [mailto:jgriffin Jonathan Griffin], [mailto:bmoss@mozilla.com Bob Moss], [mailto:mcote@mozilla.com Mark Côté]&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=testing/, tools/httptester/, tools/page-loader/, tools/test-harness/, tools/tests/, tools/testserver/, tools/testy/&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::Infrastructure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JS Marionette&lt;br /&gt;
|description=NodeJS test harness, marionette client, and other utilities for running marionette tests (submodule of Test Infrastructure)&lt;br /&gt;
|owner=[mailto:jlal@mozilla.com James Lal] &amp;lt;lightsofapollo&amp;gt;, [mailto:gaye@mozilla.com Gareth Aye] &amp;lt;gaye&amp;gt;&lt;br /&gt;
|peers=[mailto:aus@mozilla.com Ghislain &amp;quot;Aus&amp;quot; Lacroix] &amp;lt;auswerk&amp;gt;&lt;br /&gt;
|source_dirs=gaia/tests/jsmarionette&lt;br /&gt;
|components=Testing::JSMarionette&lt;br /&gt;
|group=dev-gaia&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCShell Test Harness&lt;br /&gt;
|description=The XPCShell Harness&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|source_dirs=testing/xpcshell&lt;br /&gt;
|components=Testing::XPCShell Harness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Update Service&lt;br /&gt;
|description=server code for Mozilla Update services (aus, addons, pfs)&lt;br /&gt;
|owner=Mike Morgan&lt;br /&gt;
|peers=[mailto:jscott@mozilla.com Justin Scott], [mailto:shaver@mozilla.org Mike Shaver], [mailto:wclouser@mozilla.com Will Clouser]&lt;br /&gt;
|group=dev-amo&lt;br /&gt;
|source_dirs=webtools/addons/, webtools/aus/, webtools/update/&lt;br /&gt;
|url=http://wiki.mozilla.org/wiki/AMO&lt;br /&gt;
|components=AUS::Administration, AUS::Systems&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=View System&lt;br /&gt;
|description=The View Manager is responsible for handling &amp;quot;heavyweight&amp;quot; rendering (some clipping, compositing) and event handling tasks.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=view/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Layout: View Rendering&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Audio&lt;br /&gt;
|description=Support for the W3C Web Audio API specification.&lt;br /&gt;
|owner=[mailto:padenot@mozilla.com Paul Adenot]&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/media/webaudio&lt;br /&gt;
|url=https://wiki.mozilla.org/Web_Audio_API&lt;br /&gt;
|components=Core::Web Audio&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Painting&lt;br /&gt;
|description=painting, display lists, and layer construction&lt;br /&gt;
|owner=[mailto:matt.woodrow@gmail.com Matt Woodrow]&lt;br /&gt;
|peers=[mailto:robert@ocallahan.org Robert O&#039;Callahan], [mailto:dbaron@dbaron.org David Baron],   [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs= layout/painting, the display list and layer related methods on nsIFrame and its subclasses&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout: Web Painting&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC&lt;br /&gt;
|description=WebRTC is responsible for realtime audio and video communication, as well as related issues like low-level camera and microphone access&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:bcampen@mozilla.com Byron Campen] [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=N/A (see submodules &amp;quot;WebRTC Media&amp;quot; and &amp;quot;WebRTC Signaling&amp;quot;)&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|peersemeritus=[mailto:pavlov@pavlov.net Stuart Parmenter], &lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/, widget/xpwidgets/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Drag and Drop, Core::Widget, Core::Printing: Setup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Android&lt;br /&gt;
|description=The Android Port&lt;br /&gt;
|owner=[mailto:blassey.bugs@lassey.us Brad Lassey]&lt;br /&gt;
|peers=[mailto:jwillcox@mozilla.com James Willcox]&lt;br /&gt;
|group=dev-platforms-mobile&lt;br /&gt;
|source_dirs=widget/android/, embedding/android&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Android&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - GTK&lt;br /&gt;
|description=supported X widgetry and gfx&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|ownersemeritus=[mailto:robert@ocallahan.org Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/gtk/, widget/gtk2/, widget/gtksuperwin/, widget/gtkxtbin/&lt;br /&gt;
|url=http://www.mozilla.org/unix/, http://www.gtk.org, http://www.mozilla.org/ports/gtk/&lt;br /&gt;
|components=Core::Widget: Gtk&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - OS X&lt;br /&gt;
|description= Gecko&#039;s OS X compatibility layer.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas], [mailto:bgirard@mozilla.com Benoit Girard], [mailto:spohl@mozilla.com Stephen Pohl], [mailto:smichaud@pobox.com Steven Michaud]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/cocoa/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Cocoa&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Windows&lt;br /&gt;
|description=Windows widgets and desktop integration&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peersemeritus=[mailto:blassey@mozilla.com Brad Lassey], [mailto:netzen@gmail.com Brian Bondy], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:doug.turner@gmail.com Doug Turner], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref], [mailto:robarnold@cmu.edu Rob Arnold]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/windows/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Win32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XBL&lt;br /&gt;
|description=eXtensible Binding Language&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|ownersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=dom/xbl/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xbl/&lt;br /&gt;
|components=Core::XBL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XML&lt;br /&gt;
|description=XML in Mozilla, including XML, XHTML, Namespaces in XML, Associating Style Sheets with XML Documents, XML Linking and XML Extras. XML-related things that are not covered by more specific projects.&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=dev-tech-xml&lt;br /&gt;
|source_dirs=dom/xml/, extensions/xmlextras/, parser/expat/&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/xml/&lt;br /&gt;
|components=Core::XML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPApps&lt;br /&gt;
|description=Cross-Platform Applications, mostly Navigator front end and application shell.&lt;br /&gt;
|owner=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|peers=[mailto:dean_tessman@hotmail.com Dean Tessman], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-apps-seamonkey&lt;br /&gt;
|source_dirs=xpfe/&lt;br /&gt;
|url=http://www.mozilla.org/xpapps/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCOM&lt;br /&gt;
|description=The cross-platform object model and core data structures.&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd]&lt;br /&gt;
|peers=[https://mozillians.org/en-US/u/bsmedberg/ Benjamin Smedberg], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[https://mozillians.org/en-US/u/dougt/ Doug Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=startupcache/, xpcom/%, xpcom/base/, xpcom/build/, xpcom/components/, xpcom/ds/, xpcom/glue/, xpcom/proxy/, xpcom/sample/, xpcom/stub/, xpcom/tests/, xpcom/threads/, xpcom/tools/, xpcom/windbgdlg/&lt;br /&gt;
|url=http://developer.mozilla.org/en/XPCOM&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPConnect&lt;br /&gt;
|description=Deep Magic&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:gkrizsanits@mozilla.com Gabor Krizsanits], [mailto:amccreight@mozilla.com Andrew McCreight]&lt;br /&gt;
|peersemeritus=[mailto:gal@uci.edu Andreas Gal], [mailto:jstenback@gmail.com Johnny Stenback]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=js/xpconnect/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::XPConnect&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPIDL&lt;br /&gt;
|description=Cross-platform IDL compiler; produces .h C++ header files and .xpt runtime type description files from .idl interface description files.&lt;br /&gt;
|owner=[mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|peersemeritus=[mailto:shaver@mozilla.org Mike Shaver], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=xpcom/typelib/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xpidl&lt;br /&gt;
http://www.mozilla.org/scriptable&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPInstall&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-xpinstall&lt;br /&gt;
|source_dirs=xpinstall/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Installer: XPInstall Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=xptcall&lt;br /&gt;
|description=XPTCall - platform-specific assembly for calling and implementing arbitrary XPCOM interfaces.&lt;br /&gt;
|owner=&lt;br /&gt;
|ownersemeritus=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:shaver@mozilla.org Mike Shaver]&lt;br /&gt;
|group=dev-xpcom&lt;br /&gt;
|source_dirs=xpcom/reflect/xptcall/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xptcall-faq.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPToolkit&lt;br /&gt;
|description=Cross-platform user interface toolkit&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Jan.Varga@gmail.com Jan Varga]&lt;br /&gt;
|group=dev-tech-xul&lt;br /&gt;
|source_dirs=dom/xul/, layout/xul/&lt;br /&gt;
|url=http://www.mozilla.org/xpfe/&lt;br /&gt;
|components=Core::XP Toolkit/Widgets: Menus, Core::XP Toolkit/Widgets: XUL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XSLT Processor&lt;br /&gt;
|description=XSLT transformations processor&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:axel@pike.org Axel Hecht], [mailto:erahm@mozilla.com Eric Rahm]&lt;br /&gt;
|peersemeritus=[mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xslt&lt;br /&gt;
|source_dirs=dom/xslt/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xslt/, http://www.w3.org/TR/xslt.html&lt;br /&gt;
|components=Core::XSLT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XTF&lt;br /&gt;
|description=eXtensible Tag Framework&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:alex@croczilla.com alex@croczilla.com], [mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=content/xtf/, layout/xtf/&lt;br /&gt;
|url=http://www.croczilla.com/bits_and_pieces/xtf/&lt;br /&gt;
|components=Core::XTF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing&lt;br /&gt;
|description=Cross platform sandboxing&lt;br /&gt;
|owner=[mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|peers=[mailto:bowen@mozilla.com Bob Owen], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:gDestuynder@mozilla.com Guillaume Destuynder], [mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Windows &lt;br /&gt;
|description=Sandboxing for the Windows platform &lt;br /&gt;
|owner=[mailto:bowen@mozilla.com Bob Owen]&lt;br /&gt;
|peers=[mailto:netzen@gmail.com Brian Bondy], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:jimm@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/win &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - OSX &lt;br /&gt;
|description=Sandboxing for the OSX platform &lt;br /&gt;
|owner=[mailto:haftandilian@mozilla.com Haik Aftandilian]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox/mac &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing -  Linux &amp;amp; B2G&lt;br /&gt;
|description=Sandboxing for the Linux &amp;amp; B2G platforms&lt;br /&gt;
|owner=[mailto:jhector@mozilla.com Julian Hector]&lt;br /&gt;
|peers=[mailto:jld@mozilla.com Jed Davis] [mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/linux&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Submodules===&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Fennec&lt;br /&gt;
|description=Submodule of the build config covering Fennec&#039;s build system in mobile/android.&lt;br /&gt;
|owner=[mailto:nalexander@mozilla.com Nicholas Alexander]&lt;br /&gt;
|peers=Same as Build Config&lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Media&lt;br /&gt;
|description=Submodule of WebRTC responsible for access to media input devices (microphones, cameras, screen capture), as well as realtime audiovisual codecs and packetization.&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:pkerr@mozilla.com Paul Kerr], [mailto:jib@mozilla.com Jan-Ivar Bruaroey]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc, /dom/media/webrtc&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Audio/Video)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Signaling&lt;br /&gt;
|description=Submodule of WebRTC responsible for implementation of PeerConnection API, WebRTC identity, and SDP/JSEP handling&lt;br /&gt;
|owner=[mailto:bcampen@mozilla.com Byron Campen]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:abr@mozilla.com Adam Roach], [mailto:rjesup@mozilla.com Randell Jesup], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|peersemeritus=[mailto:ehugg@cisco.com Ethan Hugg]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc/signaling/&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Signaling)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unassigned Bugzilla Components===&lt;br /&gt;
&lt;br /&gt;
The following Bugzilla components in the Core project have not been assigned to a module (this list is not exhaustive):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Core::File Handling&lt;br /&gt;
Core::Find Backend&lt;br /&gt;
Core::Gecko Profiler&lt;br /&gt;
Core::General&lt;br /&gt;
Core::HTML: Form Submission&lt;br /&gt;
Core::History: Global&lt;br /&gt;
Core::Image Blocking&lt;br /&gt;
Core::JavaScript Debugging APIs&lt;br /&gt;
Core::Localization&lt;br /&gt;
Core::Nanojit&lt;br /&gt;
Core::Networking: Domain Lists&lt;br /&gt;
Core::Print Preview&lt;br /&gt;
Core::Printing: Output&lt;br /&gt;
Core::Printing: Setup&lt;br /&gt;
Core::Profile: BackEnd&lt;br /&gt;
Core::Profile: Migration&lt;br /&gt;
Core::Profile: Roaming&lt;br /&gt;
Core::QuickLaunch (AKA turbo mode)&lt;br /&gt;
Core::Rewriting and Analysis&lt;br /&gt;
Core::Selection&lt;br /&gt;
Core::Serializers&lt;br /&gt;
Core::Spelling checker&lt;br /&gt;
Core::Tracking&lt;br /&gt;
Core::Web Services&lt;br /&gt;
Core::WebDAV&lt;br /&gt;
Core::Widget: OS/2&lt;br /&gt;
Core::Widget: Photon&lt;br /&gt;
Core::X-remote&lt;br /&gt;
Core::XForms&lt;br /&gt;
Core::XUL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1143582</id>
		<title>Modules/Core</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Modules/Core&amp;diff=1143582"/>
		<updated>2016-08-11T15:04:24Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Only module owners may edit this page.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
They may:&lt;br /&gt;
&lt;br /&gt;
* update any information about their module except the name of the owner&lt;br /&gt;
* add or remove sub-modules&lt;br /&gt;
* change the owner of a sub-module &lt;br /&gt;
* add emeritus owners or peers&lt;br /&gt;
&lt;br /&gt;
Other changes, including changes of module owner or addition/removal of modules, must be agreed with the Module Ownership Module group, probably via a discussion in [https://www.mozilla.org/about/forums/#governance mozilla.governance].&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Accessibility&lt;br /&gt;
|description=Support for platform accessibility APIs. Accessibility APIs are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and UI controls, as well as important events like changes of focus.&lt;br /&gt;
|owner=[mailto:surkov.alexander@gmail.com Alexander Surkov]&lt;br /&gt;
|peers=[mailto:bolterbugz@gmail.com David Bolter], [mailto:trev.saunders@gmail.com Trevor Saunders], [mailto:marco.zehe@googlemail.com Marco Zehe]&lt;br /&gt;
|ownersemeritus=[mailto:aaron@moonset.net. Aaron Leventhal]&lt;br /&gt;
|peersemeritus=[mailto:ginn.chen@oracle.com Ginn Chen], Evan Yan&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Browser WebAPI&lt;br /&gt;
|description=Web API for rendering apps, browser windows and widgets.&lt;br /&gt;
|owner=[mailto:kchen@mozilla.com Kan-Ru Chen]&lt;br /&gt;
|peers=[mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:fabrice@mozilla.com Fabrice Desré]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/browser-element/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build and Release Tools&lt;br /&gt;
|description=Tools related to build and release automation and configuration of release builds.&lt;br /&gt;
|owner=[mailto:nthomas@mozilla.com Nick Thomas]&lt;br /&gt;
|peers=[mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:coop@mozilla.com Chris Cooper]&lt;br /&gt;
|group=release-engineering&lt;br /&gt;
|source_dirs=browser/config/mozconfigs/, mobile/android/config/mozconfigs/, xulrunner/config/mozconfigs/, b2g/config/, tools/update-packaging/&lt;br /&gt;
|url=https://wiki.mozilla.org/ReleaseEngineering&lt;br /&gt;
|components=Release Engineering::*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config&lt;br /&gt;
|description=The build system for Gecko and several mozilla.org hosted Gecko-based applications.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc] (:gps)&lt;br /&gt;
|peers=[mailto:mh@glandium.org Mike Hommey] (:glandium), [mailto:mshal@mozilla.com Mike Shal] (:mshal), [mailto:ted@mielczarek.org Ted Mielczarek] (:ted), [mailto:cmanchester@mozilla.com Chris Manchester](:chmanchester)&lt;br /&gt;
|ownersemeritus=Ted Mielczarek (2008-[https://blog.mozilla.org/ted/2013/03/07/gregory-szorc-is-now-the-build-config-module-owner/ 2013]), Benjamin Smedberg (???-[http://benjamin.smedbergs.us/blog/2008-04-30/more-changing-of-the-guard-ted-mielczarek/ 2008]), &lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|source_dirs=build/, config/, python/mozbuild, tools/cross-commit, tools/cvs2hg-import.py, tools/cvsmgmt/, tools/elf-dynstr-gc/, tools/trees.pl, browser/config/mozconfigs/, mobile/config/mozconfigs/, xulrunner/config/mozconfigs/&lt;br /&gt;
|url=http://www.mozilla.org/build/&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Code Analysis and Debugging Tools&lt;br /&gt;
|description=Tools for debugging Mozilla code or for analyzing speed, memory use, and other characteristics of it.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-performance&lt;br /&gt;
|source_dirs=tools/codesighs/, tools/debug/, tools/dreftool/, tools/dumpdeps/, tools/footprint/, tools/jprof/, tools/leaky/, tools/memory/, tools/module-deps/, tools/performance/, tools/post_compile/, tools/preloader/, tools/rb/, tools/reorder/, tools/trace-malloc/, tools/uuiddeps/, &lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content HTTP Headers&lt;br /&gt;
|description=HTTP headers related to content, e.g. User-Agent, Content-Type, Accept. (Transport-related headers are the responsibility of the Necko module owner.)&lt;br /&gt;
|owner=[mailto:gerv@mozilla.org Gervase Markham]&lt;br /&gt;
|peers=[mailto:lmandel@mozilla.com Lawrence Mandel]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs= &lt;br /&gt;
|url=https://developer.mozilla.org/en/Gecko_user_agent_string_reference&lt;br /&gt;
|components=Core::Networking: HTTP&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Content Security&lt;br /&gt;
|description=Native content-based security features, including: Content Security Policy (CSP), Mixed Content Blocker (MCB), Subresource Integrity (SRI) and CORS.&lt;br /&gt;
|owner=[mailto:ckerschbaumer@mozilla.com Christoph Kerschbaumer]&lt;br /&gt;
|peers=[mailto:francois@mozilla.com François Marier], [mailto:jonas@sicking.cc Jonas Sicking],  [mailto:tvyas@mozilla.com Tanvi Vyas], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:mozilla@sidstamm.com Sid Stamm] &lt;br /&gt;
|group=dev-security&lt;br /&gt;
|source_dirs=dom/security&lt;br /&gt;
|components=Core::DOM: Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cookies and Permissions&lt;br /&gt;
|description=&lt;br /&gt;
|owner=Monica Chew&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.com Josh Matthews], [mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:mconnor@steelgryphon.com Mike Connor], [mailto:dwitte@gmail.com Dan Witte], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sdwilsh@shawnwilsher.com Shawn Wilsher (ping on irc)]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=extensions/cookie/, netwerk/cookie/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Networking: Cookies&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Cycle Collector&lt;br /&gt;
|description=Code to break and collect objects within reference cycles&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/mccr8/ Andrew McCreight]&lt;br /&gt;
|peers=Peter Van der Beken, Olli Pettay, David Baron&lt;br /&gt;
|source_dirs=xpcom/base/nsCycleCollector.* and some support headers&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=docshell&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky]&lt;br /&gt;
|peers=[mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:jst@mozilla.org Johnny Stenback], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:justin.lebar@gmail.com Justin Lebar]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=docshell/, uriloader/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Document Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Device Storage&lt;br /&gt;
|description=Support for the device storage API&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands] (:dhylands), [mailto:jvarga@mozilla.com Jan Varga] (:janv)&lt;br /&gt;
|peers=&lt;br /&gt;
|ownersemeritus=[mailto:doug.turner@gmail.com Doug Turner] (:dougt)&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/devicestorage/, dom/interfaces/devicestorage/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/WebAPI/Device_Storage&lt;br /&gt;
|components=Core::DOM: Device Interfaces&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Document Object Model&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jst@mozilla.org Johnny Stenback], [mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:Olli.Pettay@helsinki.fi Olli Pettay], [mailto:bent@mozilla.com Ben Turner], [mailto:mounir@lamouri.fr Mounir Lamouri (still active, but slower to respond than previously)], [mailto:me@kylehuey.com Kyle Huey], [mailto:justin.lebar@gmail.com Justin Lebar], [mailto:hsivonen@iki.fi Henri Sivonen], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:baku@mozilla.com Andrea Marchesini],&lt;br /&gt;
[mailto:ehsan@mozilla.com Ehsan Akhgari], [mailto:bkelly@mozilla.com Ben Kelly]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/*, except directories covered by other modules&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM, Core::DOM: CSS Object Model, Core::DOM: Core &amp;amp; HTML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Event Handling&lt;br /&gt;
|description=DOM Events and Event Handling &lt;br /&gt;
|owner=[mailto:olli@pettay.fi Olli Pettay], [mailto:masayuki@d-toybox.com Masayuki Nakano]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/events and event handling related code elsewhere &lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/DOM&lt;br /&gt;
|components=Core::DOM: Events, Core::Event Handling&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Workers&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bent@mozilla.com Ben Turner]&lt;br /&gt;
|peers=[mailto:mrbkap@mozilla.com Blake Kaplan], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/workers/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_web_workers&lt;br /&gt;
|components=Core::DOM: Workers&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IndexedDB&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:bent@mozilla.com Ben Turner]&lt;br /&gt;
|peers=[mailto:jonas@sicking.cc Jonas Sicking], [mailto:me@kylehuey.com Kyle Huey], [mailto:jvarga@mozilla.com Jan Varga]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/indexedDB/&lt;br /&gt;
|url=https://developer.mozilla.org/en/IndexedDB&lt;br /&gt;
|components=Core::DOM: IndexedDB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Editor&lt;br /&gt;
|description=&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|ownersemeritus=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=editor/&lt;br /&gt;
|url=http://www.mozilla.org/editor/&lt;br /&gt;
|components=Core::Editor&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Embedding&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jst@mozilla.org Johnny Stenback]&lt;br /&gt;
|group=dev-embedding&lt;br /&gt;
|source_dirs=embedding/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: APIs, Core::Embedding: ActiveX Wrapper, Core::Embedding: GRE Core, Core::Embedding: GTK Widget, Core::Embedding: MFC Embed, Core::Embedding: Mac, Core::Embedding: Packaging&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Find As You Type&lt;br /&gt;
|description=Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). Currently seeks new owner.&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=extensions/typeaheadfind/&lt;br /&gt;
|url=http://www.mozilla.org/access/type-ahead/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Geolocation&lt;br /&gt;
|description=Implementation of the Geolocation W3C Spec, location provider apis, and wifi scanning code.&lt;br /&gt;
|owner=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.net Josh Matthews], [mailto:kchen@mozilla.com Kan-Ru Chen], Garvan Keeley&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=dom/geolocation, dom/system/, netwerk/wifi&lt;br /&gt;
|url=https://developer.mozilla.org/En/Using_geolocation&lt;br /&gt;
|components=Core::Geolocation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Global Key Bindings&lt;br /&gt;
|description=Global hot keys in Mozilla for the browser, editor, mail-news and widgets. Does not include underlined menu accelerators and the like, as those are part of i18n.&lt;br /&gt;
|owner=Aaron Leventhal&lt;br /&gt;
|peers=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=dom/xbl/builtin/&lt;br /&gt;
|url=http://www.mozilla.org/projects/ui/accessibility/mozkeyintro.html&lt;br /&gt;
|components=Core::Keyboard: Navigation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Graphics&lt;br /&gt;
|description=Mozilla graphics API&lt;br /&gt;
|owner=[mailto:jrmuizel@mozilla.com Jeff Muizelaar](Thebes, QCMS, YCbCr, Cairo/Pixman, Regions, OS X, Other), [mailto:roc+@cs.cmu.edu Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:jdrew@mozilla.com Joe Drew], [mailto:vladimir@pobox.com Vladimir Vukicevic], [mailto:bas.schouten@live.nl Bas Schouten](Layers, Windows), [mailto:bjacob@mozilla.com Benoit Jacob](gfx/gl), [mailto:bgirard@mozilla.com Benoit Girard](Compositor, Performance), [mailto:ajuma.bugzilla@alijuma.com Ali Juma], [mailto:jgilbert@mozilla.com Jeff Gilbert](WebGL, ANGLE), [mailto:george@mozilla.com George Wright](Canvas2D, Skia), [mailto:mwoodrow@mozilla.com Matt Woodrow](Layers API), [mailto:jdaggett@mozilla.com John Daggett](text/fonts), [mailto:jfkthame@googlemail.com Jonathan Kew](text/fonts), [mailto:nsilva@mozilla.com  Nicolas Silva](MozSurface), [mailto:ncameron@mozilla.com Nick Cameron], [mailto:sikeda@mozilla.com Sotaro Ikeda](B2G), [mailto:snorp@mozilla.com James Willcox](Android), [mailto:clord@mozilla.com Christopher Lord], [mailto:mstange@themasta.com Markus Stange](OS X)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=gfx/, dom/canvas/&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX https://wiki.mozilla.org/Gecko:Layers https://wiki.mozilla.org/Gecko:2DGraphicsSketch&lt;br /&gt;
|components=Core::Graphics, Core::Graphics: Layers, Core::Graphics: Text, Core::GFX: Color Management, Core::Canvas: 2D, Core::Canvas: WebGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=APZ (Graphics submodule)&lt;br /&gt;
|description=Asynchronous panning and zooming&lt;br /&gt;
|owner=[mailto:kgupta@mozilla.com Kartikaya Gupta]&lt;br /&gt;
|peers=[mailto:bballo@mozilla.com Botond Ballo], [mailto:tnikkel@mozilla.com Timothy Nikkel], [mailto:dvander@mozilla.com David Anderson], [mailto:mstange@mozilla.com Markus Stange]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/layers/apz&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/APZ&lt;br /&gt;
|components=Core::Panning and Zooming&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Moz2D (Graphics submodule)&lt;br /&gt;
|description=Platform independent 2D graphics API&lt;br /&gt;
|owner=[mailto:bschouten@mozilla.com Bas Schouten]&lt;br /&gt;
|peers=[mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:gwright@mozilla.com George Wright], [mailto:jwatt@mozilla.com Jonathan Watt]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source=gfx/2d&lt;br /&gt;
|url=https://wiki.mozilla.org/Platform/GFX/Moz2D&lt;br /&gt;
|components=Core::Graphics&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=GTK Embedding Widget&lt;br /&gt;
|description=Gtk Widget for embedding Mozilla into Gtk applications&lt;br /&gt;
|owner=Marco Pesenti Gritti&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|group=dev-embedding&lt;br /&gt;
|source_dirs=&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Embedding: GTK Widget&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Legacy HTML Parser&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:mrbkap@gmail.com Blake Kaplan]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron], [mailto:jst@mozilla.org Johnny Stenback], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:rbs@maths.uq.edu.au rbs@maths.uq.edu.au]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=parser/htmlparser&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/doc/parser.html&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HAL&lt;br /&gt;
|description=Hardware Abstraction Layer&lt;br /&gt;
|owner=[https://mozillians.org/u/dhylands/ Dave Hylands]&lt;br /&gt;
|peers=[mailto:gsvelto@mozilla.com Gabriele Svelto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=hal/&lt;br /&gt;
|components=Core::Hardware Abstraction Layer (HAL)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=HTML Parser&lt;br /&gt;
|description=The HTML Parser transforms HTML source code into a DOM. It conforms to the HTML specification, and is mostly translated automatically from Java to C++.&lt;br /&gt;
|owner=[mailto:hsivonen@iki.fi Henri Sivonen]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=parser/html&lt;br /&gt;
|url=http://about.validator.nu/&lt;br /&gt;
|components=Core::HTML: Parser&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=I18N Library&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:jshin1987@gmail.com Jungshik Shin], [mailto:smontagu@smontagu.org Simon Montagu]&lt;br /&gt;
|peers=[mailto:VYV03354@nifty.ne.jp Masatoshi Kimura]&lt;br /&gt;
|group=dev-i18n&lt;br /&gt;
|source_dirs=intl/&lt;br /&gt;
|url=http://mozilla.org/projects/intl/index.html&lt;br /&gt;
|components=Core::Internationalization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=ImageLib&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:seth@mozilla.com Seth Fowler]&lt;br /&gt;
|peers=[mailto:netzen@gmail.com Brian Bondy], [mailto:jmuizelaar@mozilla.com Jeff Muizelaar], [mailto:jlebar@mozilla.com Justin Lebar], [mailto:tnikkel@gmail.com Timothy Nikkel]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/libjpeg/, media/libpng/, image/, modules/zlib/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::ImageLib&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=IPC&lt;br /&gt;
|description=Message-passing between threads and processes&lt;br /&gt;
|owner=[mailto:wmccloskey@mozilla.com Bill McCloskey]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:bent.mozilla@gmail.com Ben Turner], [mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=ipc/glue/, ipc/ipdl/, ipc/chromium/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::IPC}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript&lt;br /&gt;
|description=JavaScript engine (SpiderMonkey)&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:jdemooij@mozilla.com Jan de Mooij], [mailto:wmccloskey@mozilla.com Bill McCloskey], [mailto:nnethercote@mozilla.com Nick Nethercote], [mailto:jwalden@mit.edu Jeff Walden], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:evilpies@gmail.com Tom Schuster], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:till@tillschneidereit.net Till Schneidereit], [mailto:efaust@mozilla.com Eric Faust], [mailto:nfitzgerald@mozilla.com Nick Fitzgerald], [mailto:luke@mozilla.com Luke Wagner], [mailto:arai.unmht@gmail.com Tooru Fujisawa], [mailto:sunfish@mozilla.com Dan Gohman], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley], [mailto:nmatsakis@mozilla.com Niko Matsakis], [mailto:ejpbruel@mozilla.com Eddy Bruel], [mailto:danderson@mozilla.com David Anderson], [mailto:igor@mir2.org Igor Bukanov], [mailto:brendan@mozilla.org Brendan Eich], Andreas Gal&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey,&lt;br /&gt;
http://developer.mozilla.org/en/docs/About_JavaScript&lt;br /&gt;
|components=Core::JavaScript Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript JIT&lt;br /&gt;
|description=JavaScript engine&#039;s JIT compilers (IonMonkey, Baseline)&lt;br /&gt;
|owner=[mailto:jdemooij@mozilla.com Jan de Mooij]&lt;br /&gt;
|peers=[mailto:danderson@mozilla.com David Anderson], [mailto:bbouvier@mozilla.com Benjamin Bouvier], [mailto:shu@mozilla.com Shu-yu Guo], [mailto:bhackett1024@gmail.com Brian Hackett], [mailto:nicolas.b.pierron@mozilla.com Nicolas Pierron], [mailto:evilpies@gmail.com  Tom Schuster], [mailto:sstangl@mozilla.com Sean Stangl], [mailto:hv1989@gmail.com Hannes Verschore], [mailto:kvijayan@mozilla.com Kannan Vijayan], [mailto:luke@mozilla.com Luke Wagner]&lt;br /&gt;
|group=dev-tech-js-engine-internals&lt;br /&gt;
|source_dirs=js/src/jit&lt;br /&gt;
|url=http://www.mozilla.org/js/spidermonkey&lt;br /&gt;
|components=Core::JavaScript Engine: JIT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JavaScript Debugger Backend&lt;br /&gt;
|description=JavaScript debugging hooks&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:rginda@hacksrus.com Rob Ginda]&lt;br /&gt;
|group=dev-apps-js-debugger&lt;br /&gt;
|source_dirs=js/jsd/&lt;br /&gt;
|url=http://www.mozilla.org/js/jsd&lt;br /&gt;
|components=Other Applications::Venkman JS Debugger&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=jsat&lt;br /&gt;
|description=Javascript screen reader that is used in Android and B2G&lt;br /&gt;
|owner=[mailto:eitan@monotonous.org Eitan Isaacson]&lt;br /&gt;
|peers=[mailto:yzenevich@mozilla.com Yura Zenevich]&lt;br /&gt;
|group=dev-accessibility&lt;br /&gt;
|source_dirs=accessible/jsat/&lt;br /&gt;
|url=http://www.mozilla.org/access/&lt;br /&gt;
|components=Core::Disability Access APIs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-ctypes&lt;br /&gt;
|description=A foreign function interface which allows privileged JS code to interact with binary code without using XPCOM/XPConnect.&lt;br /&gt;
|owner=[mailto:jorendorff@mozilla.com Jason Orendorff]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/src/ctypes/&lt;br /&gt;
|url=https://wiki.mozilla.org/JSctypes&lt;br /&gt;
|components=Core::js-ctypes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=js-tests&lt;br /&gt;
|description=JavaScript test suite&lt;br /&gt;
|owner=[mailto:bclary@bclary.com Bob Clary]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tests/&lt;br /&gt;
|url=http://www.mozilla.org/js/tests/library.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Layout Engine&lt;br /&gt;
|description=rendering tree construction, layout (reflow), painting, etc.&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan], [mailto:bzbarsky@mit.edu Boris Zbarsky],  [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:jfkthame@gmail.com Jonathan Kew], [mailto:tnikkel@gmail.com Timothy Nikkel], [mailto:matt.woodrow@gmail.com Matt Woodrow], [mailto:xidorn+moz@upsuper.org Xidorn Quan]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/%, layout/base/, layout/build/, layout/doc/, layout/forms/, layout/generic/, layout/html/, layout/macbuild/, layout/printing/, layout/tables/, layout/tools/&lt;br /&gt;
|url=http://mozilla.org/newlayout/doc/ ,&lt;br /&gt;
http://lxr.mozilla.org/mozilla/source/layout/doc/&lt;br /&gt;
|components=Core::Layout, Core::Layout: Block and Inline, Core::Layout: Floats, Core::Layout: Form Controls, Core::Layout: HTML Frames, Core::Layout: Images, Core::Layout: Misc Code, Core::Layout: R &amp;amp; A Pos, Core::Layout: Tables, Core::Layout: Text, Core::Layout: View Rendering, Core::Print Preview, Core::Printing: Output&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=libjar&lt;br /&gt;
|description=The JAR handling code (protocol handler, stream implementation, and zipreader/zipwriter).&lt;br /&gt;
|owner=[mailto:mwu@mozilla.com Michael Wu]&lt;br /&gt;
|peers=[mailto:aklotz@mozilla.com Aaron Klotz]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libjar&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=MathML&lt;br /&gt;
|description=MathML is a low-level specification for describing mathematics which provides a foundation for the inclusion of mathematical expressions in Web pages.&lt;br /&gt;
|owner=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|peers=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan]&lt;br /&gt;
|group=dev-tech-mathml&lt;br /&gt;
|source_dirs=layout/mathml/&lt;br /&gt;
|url=http://www.mozilla.org/projects/mathml/&lt;br /&gt;
|components=Core::MathML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Playback&lt;br /&gt;
|description=HTML Media APIs, including Media Source Extensions and non-MSE video/audio element playback, and Encrypted Media Extensions. (WebRTC and WebAudio not included).&lt;br /&gt;
|owner=[mailto:cpearce@mozilla.com Chris Pearce]&lt;br /&gt;
|peers=[mailto:ajones@mozilla.com Anthony Jones], [mailto:kinetik@flim.org Matthew Gregan], [mailto:eflores@mozilla.com Edwin Flores], [mailto:jyavenard@mozilla.com Jean-Yves Avenard], [mailto:gsquelart@mozilla.com Gerald Squelart], [mailto:rgiles@mozilla.com Ralph Giles], [mailto:jwwang@mozilla.com JW Wang]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=dom/media, media/gmp-clearkey/, media/libcubeb/, media/libnestegg/, media/libogg/, media/libopus/, media/libstagefright/, media/libtheora/, media/libtremor/, media/libvorbis/, media/libvpx/, media/omx-plugin/, media/rlz/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Audio/Video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Media Transport&lt;br /&gt;
|description=Pluggable transport for real-time media&lt;br /&gt;
|owner=[mailto:ekr@rtfm.com Eric Rescorla]&lt;br /&gt;
|peers=[mailto:bcampen@mozilla.com Byron Campen], [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=media/mtransport&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::WebRTC::Networking&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Memory Allocator&lt;br /&gt;
|description=Most things related to memory allocation in Gecko, including jemalloc, replace-malloc, DMD (dark matter detector), logalloc, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:n.nethercote@gmail.com Nicholas Nethercote]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=memory/&lt;br /&gt;
|components=Core::DMD, Core::jemalloc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mfbt&lt;br /&gt;
|description=mfbt is a collection of headers, macros, data structures, methods, and other functionality available for use and reuse throughout all Mozilla code (including SpiderMonkey and Gecko more broadly).&lt;br /&gt;
|owner=[mailto:jwalden@mit.edu Jeff Walden]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd], [mailto:Ms2ger@gmail.com Ms2ger], [mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mfbt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::MFBT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozApps API &amp;amp; UI&lt;br /&gt;
|description=Implementation of the navigator.mozApps API&lt;br /&gt;
|owner=[mailto:fabrice@mozilla.com Fabrice Desré], [mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:myk@mozilla.org Myk Melez], [mailto:mar.castelluccio@studenti.unina.it Marco Castelluccio], [mailto:ferjmoreno@gmail.com Fernando Jiménez]&lt;br /&gt;
|group=dev-webapi&lt;br /&gt;
|source_dirs=dom/apps/, dom/interfaces/apps, product specific files implementing UI hooks.&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::DOM: Apps&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Mozglue&lt;br /&gt;
|description=Glue library containing various low-level functionality, including a dynamic linker for Android, a DLL block list for Windows, etc.&lt;br /&gt;
|owner=[mailto:mh+mozilla@glandium.org Mike Hommey]&lt;br /&gt;
|peers=[mailto:froydnj@mozilla.com Nathan Froyd] (mozglue/linker), [mailto:kgupta@mozilla.com Kartikaya Gupta] (mozglue/android), [mailto:nchen@mozilla.com Jim Chen] (mozglue/android)&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=mozglue/&lt;br /&gt;
|components=Core::mozglue&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=mozilla-toplevel&lt;br /&gt;
|description=The top level directory for the mozilla tree.&lt;br /&gt;
|owner=[mailto:brendan@mozilla.org Brendan Eich]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=tools/README&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Necko&lt;br /&gt;
|description=The Mozilla Networking Library&lt;br /&gt;
|owner=[mailto:mcmanus@ducksong.com Patrick McManus]&lt;br /&gt;
|peers= [mailto:jduell.mcbugs@gmail.com Jason Duell], [mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:mnovotny@mozilla.com Michal Novotny], [mailto:hurley@mozilla.com Nick Hurley], [mailto:dd.mozilla@gmail.com  Dragana Damjanovic ],[mailto:valentin.gosu@gmail.com Valentin Gosu],[mailto:daniel@haxx.se Daniel Stenberg ]&lt;br /&gt;
|peersemeritus= [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:sworkman@mozilla.com Steve Workman]&lt;br /&gt;
|group=dev-tech-network&lt;br /&gt;
|source_dirs=netwerk/%, netwerk/base/, netwerk/build/, netwerk/cache/, netwerk/dns/, netwerk/locales/, netwerk/mime/, netwerk/protocol/, netwerk/resources/, netwerk/socket/, netwerk/streamconv/, netwerk/system/, netwerk/test/, netwerk/testserver/&lt;br /&gt;
|url=http://www.mozilla.org/projects/netlib/, https://developer.mozilla.org/en/Necko&lt;br /&gt;
|components=Core::Networking, Core::Networking: Cache, Core::Networking: Cookies, Core::Networking: FTP, Core::Networking: File, Core::Networking: HTTP, Core::Networking: JAR, Core::Networking: Websockets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=NSPR&lt;br /&gt;
|description=Netscape Portable Runtime&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:wtc@google.com Wan-Teh Chang], [mailto:mh@glandium.org Mike Hommey], [mailto:kaie@kuix.de Kai Engert]&lt;br /&gt;
|group=dev-tech-nspr&lt;br /&gt;
|source_dirs=nsprpub/&lt;br /&gt;
|url=http://www.mozilla.org/projects/nspr/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/reference/html/&lt;br /&gt;
http://www.mozilla.org/projects/nspr/release-notes/&lt;br /&gt;
|components=NSPR&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PDF&lt;br /&gt;
|description=Rendering code to display documents encoded in the ISO 32000-1 `PDF&#039; format.&lt;br /&gt;
|owner=Chris Jones, Andreas Gal&lt;br /&gt;
|peers=[mailto:aadib@mozilla.com Artur Adib], [mailto:bdahl@mozilla.com Brendan Dahl], [mailto:vnicolas@mozilla.com Vivien Nicolas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=media/pdf/&lt;br /&gt;
|url=https://github.com/mozilla/pdf.js&lt;br /&gt;
|components=Core::PDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Plugins&lt;br /&gt;
|description= NPAPI Plugin support.&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:jst@mozilla.org Johnny Stenback], [mailto:roc+@cs.cmu.edu Robert O&#039;Callahan], [mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:joshmoz@gmail.com Josh Aas]&lt;br /&gt;
|peersemeritus=[mailto:john@pointysoftware.net John Schoenick]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/plugins/, modules/plugin/&lt;br /&gt;
|url=https://wiki.mozilla.org/Plugins&lt;br /&gt;
|components=Core::Plug-ins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Preferences&lt;br /&gt;
|description=Preference library&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=modules/libpref/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Preferences: Backend&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Private Browsing&lt;br /&gt;
|description=Implementation of the Private Browsing mode, and the integration of other modules with Private Browsing APIs.&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:josh@joshmatthews.net Josh Matthews]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=Implementation and consumers of Private Browsing APIs in nsILoadContext, nsIPrivateBrowsingChannel, PrivateBrowsingUtils.jsm and the related glue code. &lt;br /&gt;
|url=https://wiki.mozilla.org/Private_Browsing&lt;br /&gt;
|components=Firefox::Private Browsing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Privilege Manager&lt;br /&gt;
|description=&amp;quot;caps&amp;quot;&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dveditz@mozilla.com Dan Veditz], [mailto:jst@mozilla.org Johnny Stenback]&lt;br /&gt;
|group=dev-tech-dom&lt;br /&gt;
|source_dirs=caps/&lt;br /&gt;
|url=http://www.mozilla.org/projects/security/components/index.html&lt;br /&gt;
|components=Core::Security: CAPS&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Push Notifications&lt;br /&gt;
|description=Push is a way for application developers to send messages to their web applications.&lt;br /&gt;
|owner=[mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|peers=[mailto:nsm.nikhil@gmail.com Nikhil Marathe], [mailto:kcambridge@mozilla.com Kit Cambridge], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ddamjanovic@mozilla.com Dragana Damjanovic]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=dom/push, dom/simplepush&lt;br /&gt;
|url=&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=PyXPCOM&lt;br /&gt;
|description=The Python to XPCOM bridge.&lt;br /&gt;
|owner=Todd Whiteman&lt;br /&gt;
|peers=[mailto:mhammond@skippinet.com.au Mark Hammond]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=extension/python&lt;br /&gt;
|url=https://developer.mozilla.org/en/PyXPCOM&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Qt-based gfx and widget&lt;br /&gt;
|description=Qt-based rendering and widget code&lt;br /&gt;
|owner=[mailto:romaxa@gmail.com Oleg Romashin]&lt;br /&gt;
|peers=[mailto:mozilla@rosenauer.org Wolfgang Rosenauer], [mailto:doug.turner@gmail.com Doug Turner]&lt;br /&gt;
|group=dev-tech-widget&lt;br /&gt;
|source_dirs=widget/qt/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Qt&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=RDF&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:axel@pike.org Axel Hecht]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-rdf&lt;br /&gt;
|source_dirs=rdf/&lt;br /&gt;
|url=http://www.mozilla.org/rdf/doc/&lt;br /&gt;
|components=Core::RDF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=security&lt;br /&gt;
|description=Crypto/PKI code, including NSS (Network Security Services) and JSS (NSS for Java)&lt;br /&gt;
|owner=[mailto:rrelyea@redhat.com Bob Relyea], [mailto:wtc@google.com Wan-Teh Chang]&lt;br /&gt;
|peers=[mailto:emaldona@redhat.com Elio Maldonado], [mailto:kaie@kuix.de Kai Engert], [mailto:ryan.sleevi@gmail.com Ryan Sleevi], [mailto:ekr@rtfm.com Eric Rescorla], [mailto:franziskuskiefer@gmail.com Franziskus Kiefer], [mailto:martin.thomson@gmail.com Martin Thomson], [mailto:ttaubert@mozilla.com Tim Taubert]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=dbm/, security/coreconf/, security/dbm/, security/jss/, security/nss/, security/tinderbox/, security/tinderlight/&lt;br /&gt;
|url=http://mozilla.org/projects/security/pki/&lt;br /&gt;
|components=NSS, JSS, Core::Security, Core::Security: S/MIME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Security - Mozilla PSM Glue&lt;br /&gt;
|description=Personal Security Manager&lt;br /&gt;
|owner=[mailto:dkeeler@mozilla.com David Keeler]&lt;br /&gt;
|peers=[mailto:honzab.moz@firemni.cz Honza Bambas], [mailto:cykesiopka.bmo@gmail.com Cykesiopka]&lt;br /&gt;
|group=dev-tech-crypto&lt;br /&gt;
|source_dirs=security/manager/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Security: PSM, Core::Security: UI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Static analysis &amp;amp; rewriting for C++&lt;br /&gt;
|description=Tools for checking C++ code looking for problems at compile time, plus tools for automated rewriting of C++ code.&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:sfink@mozilla.com Steve Fink], [mailto:michael@thelayzells.com Michael Layzell], [mailto:jrmuizel@mozilla.com Jeff Muizelaar], [mailto:birunthan@mohanathas.com Birunthan Mohanathas]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=build/clang-plugin, tools/rewriting among other out of tree tools&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Rewriting &amp;amp; Analysis&lt;br /&gt;
}}&lt;br /&gt;
{{Module&lt;br /&gt;
|name=storage&lt;br /&gt;
|description=Storage APIs with a SQLite backend&lt;br /&gt;
|owner=[mailto:mak77@bonardo.net Marco Bonardo]&lt;br /&gt;
|peers=[mailto:bugmail@asutherland.org Andrew Sutherland], [mailto:bent.mozillla@gmail.com Ben Turner]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=db/sqlite3/, storage/&lt;br /&gt;
|url=http://developer.mozilla.org/en/docs/Storage&lt;br /&gt;
|components=Toolkit::Storage, Core::SQL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=String&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:jlebar@mozilla.com Justin Lebar]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=string/, xpcom/string/&lt;br /&gt;
|url=https://developer.mozilla.org/En/Mozilla_internal_string_guide&lt;br /&gt;
|components=Core::String&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Style System&lt;br /&gt;
|description=CSS style sheet handling; style data computation&lt;br /&gt;
|owner=[mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:cam@mcc.id.au Cameron McCormack]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=layout/style/&lt;br /&gt;
|url=https://wiki.mozilla.org/Gecko:Overview#Style_System&lt;br /&gt;
|components=Core::CSS Parsing and Computation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=SVG&lt;br /&gt;
|description=Scalable Vector Graphics&lt;br /&gt;
|owner=[mailto:jwatt@jwatt.org Jonathan Watt]&lt;br /&gt;
|peers=[mailto:longsonr@gmail.com Robert Longson], [mailto:roc+@cs.cmu.edu Robert O&#039;Callahan], [mailto:dholbert@mozilla.com Daniel Holbert], [mailto:birtles@gmail.com Brian Birtles]&lt;br /&gt;
|group=dev-tech-svg&lt;br /&gt;
|source_dirs=dom/svg/, layout/svg/, dom/smil/&lt;br /&gt;
|url=https://developer.mozilla.org/en-US/docs/Web/SVG&lt;br /&gt;
|components=Core::SVG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Tamarin&lt;br /&gt;
|description=VM for ActionScript and JavaScript&lt;br /&gt;
|owner=Edwin Smith, [mailto:jodyer@adobe.com Jeff Dyer]&lt;br /&gt;
|peers=[mailto:brendan@mozilla.org Brendan Eich], [mailto:stejohns@adobe.com Steven Johnson], [mailto:tierney@adobe.com Erik Tierney], [mailto:treilly@adobe.com Tom Reilly]&lt;br /&gt;
|group=dev-tech-js-engine&lt;br /&gt;
|source_dirs=js/tamarin&lt;br /&gt;
|url=http://www.mozilla.org/projects/tamarin/&lt;br /&gt;
http://wiki.mozilla.org/tamarin/&lt;br /&gt;
http://hg.mozilla.org/tamarin-central/&lt;br /&gt;
http://hg.mozilla.org/tamarin-tracing/&lt;br /&gt;
|components=Tamarin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Test Harness&lt;br /&gt;
|description=In-tree test infrastructure and tools. Harnesses include, XPCShell, Mochitest (&amp;amp; Chrome), Reftest, JsREftest, Compiled Code Tests, Robocop, Mozmill, Marionette, Firefox UI Tests. Requests for new harnesses should go to Testing::General.&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:dbaron@dbaron.org David Baron] (reftest), [mailto:jwalden@mit.edu Jeff Walden] (httpd.js, jsreftest), Rob Campbell (mochitest, mochitest chrome, marionette), [mailto:jmaher@mozilla.com Joel Maher] (reftest, mochitest, jsreftest), [mailto:ctalbert@mozilla.com Clint Talbert] (reftest, compiled code, mozmill), [mailto:geoffbrown@mozilla.com Geoff Brown] (robocop), [mailto:hskupin@mozilla.com Henrik Skupin] (Marionette, Firefox UI tests), [mailto:ato@mozilla.com Andreas Tolfsen] (marionette), [mailto:jgriffin Jonathan Griffin] (marionette), [mailto:dburns@mozilla.com David Burns] (marionette) [mailto:dminor@mozilla.com Dan Minor], [mailto:mjzffr@gmail.com Maja Frydrychowicz] (Marionette, Firefox UI tests), &lt;br /&gt;
&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=/testing&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::General, Testing::Mochitest, Testing::Mochitest Chrome, Testing::Marionette, Testing::Mozmill, Testing::Reftest, Testing::XPCShell Harness, Testing::httpd.js&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Testing Infrastructure&lt;br /&gt;
|description=Testing tools and infrastructure for Mozilla projects, harnesses for automated tests, stand-alone test tools. Talos, Graph Server, Mozbase, Pulse, WOO, Bughunter, SUTAgent, Eideticker&lt;br /&gt;
|owner=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|peers=[mailto:bclary@bclary.com Bob Clary], [mailto:bhearsum@mozilla.com Ben Hearsum], [mailto:ccooper@deadsquid.com Chris Cooper], [mailto:ctalbert@mozilla.com Clint Talbert], [mailto:robert@roberthelmer.com Robert Helmer], [mailto:jmaher@mozilla.com Joel Maher], Rob Campbell, [mailto:wlach@mozilla.com William Lachance], [mailto:jeads@mozilla.com Jonathan Eads], [mailto:jgriffin Jonathan Griffin], [mailto:bmoss@mozilla.com Bob Moss], [mailto:mcote@mozilla.com Mark Côté]&lt;br /&gt;
|group=dev-quality&lt;br /&gt;
|source_dirs=testing/, tools/httptester/, tools/page-loader/, tools/test-harness/, tools/tests/, tools/testserver/, tools/testy/&lt;br /&gt;
|url=http://wiki.mozilla.org/SoftwareTesting&lt;br /&gt;
|components=Testing::Infrastructure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=JS Marionette&lt;br /&gt;
|description=NodeJS test harness, marionette client, and other utilities for running marionette tests (submodule of Test Infrastructure)&lt;br /&gt;
|owner=[mailto:jlal@mozilla.com James Lal] &amp;lt;lightsofapollo&amp;gt;, [mailto:gaye@mozilla.com Gareth Aye] &amp;lt;gaye&amp;gt;&lt;br /&gt;
|peers=[mailto:aus@mozilla.com Ghislain &amp;quot;Aus&amp;quot; Lacroix] &amp;lt;auswerk&amp;gt;&lt;br /&gt;
|source_dirs=gaia/tests/jsmarionette&lt;br /&gt;
|components=Testing::JSMarionette&lt;br /&gt;
|group=dev-gaia&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCShell Test Harness&lt;br /&gt;
|description=The XPCShell Harness&lt;br /&gt;
|owner=[mailto:ted@mielczarek.org Ted Mielczarek]&lt;br /&gt;
|peers=[mailto:jmaher@mozilla.com Joel Maher]&lt;br /&gt;
|source_dirs=testing/xpcshell&lt;br /&gt;
|components=Testing::XPCShell Harness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Update Service&lt;br /&gt;
|description=server code for Mozilla Update services (aus, addons, pfs)&lt;br /&gt;
|owner=Mike Morgan&lt;br /&gt;
|peers=[mailto:jscott@mozilla.com Justin Scott], [mailto:shaver@mozilla.org Mike Shaver], [mailto:wclouser@mozilla.com Will Clouser]&lt;br /&gt;
|group=dev-amo&lt;br /&gt;
|source_dirs=webtools/addons/, webtools/aus/, webtools/update/&lt;br /&gt;
|url=http://wiki.mozilla.org/wiki/AMO&lt;br /&gt;
|components=AUS::Administration, AUS::Systems&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=View System&lt;br /&gt;
|description=The View Manager is responsible for handling &amp;quot;heavyweight&amp;quot; rendering (some clipping, compositing) and event handling tasks.&lt;br /&gt;
|owner=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:dbaron@dbaron.org David Baron]&lt;br /&gt;
|group=dev-tech-layout&lt;br /&gt;
|source_dirs=view/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Layout: View Rendering&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Web Audio&lt;br /&gt;
|description=Support for the W3C Web Audio API specification.&lt;br /&gt;
|owner=[mailto:ehsan@mozilla.com Ehsan Akhgari]&lt;br /&gt;
|peers=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan], [mailto:padenot@mozilla.com Paul Adenot], [mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=dom/media/webaudio&lt;br /&gt;
|url=https://wiki.mozilla.org/Web_Audio_API&lt;br /&gt;
|components=Core::Web Audio&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC&lt;br /&gt;
|description=WebRTC is responsible for realtime audio and video communication, as well as related issues like low-level camera and microphone access&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:ehugg@cisco.com Ethan Hugg],  [mailto:bcampen@mozilla.com Byron Campen] [mailto:abr@mozilla.com Adam Roach]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=N/A (see submodules &amp;quot;WebRTC Media&amp;quot; and &amp;quot;WebRTC Signaling&amp;quot;)&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:pavlov@pavlov.net Stuart Parmenter], [mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/, widget/xpwidgets/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Drag and Drop, Core::Widget, Core::Printing: Setup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Android&lt;br /&gt;
|description=The Android Port&lt;br /&gt;
|owner=[mailto:blassey.bugs@lassey.us Brad Lassey]&lt;br /&gt;
|peers=[mailto:jwillcox@mozilla.com James Willcox]&lt;br /&gt;
|group=dev-platforms-mobile&lt;br /&gt;
|source_dirs=widget/android/, embedding/android&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Android&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - GTK&lt;br /&gt;
|description=supported X widgetry and gfx&lt;br /&gt;
|owner=[mailto:roc+@cs.cmu.edu Robert O&#039;Callahan]&lt;br /&gt;
|peers=[mailto:karlt+@karlt.net Karl Tomlinson]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/gtk/, widget/gtk2/, widget/gtksuperwin/, widget/gtkxtbin/&lt;br /&gt;
|url=http://www.mozilla.org/unix/, http://www.gtk.org, http://www.mozilla.org/ports/gtk/&lt;br /&gt;
|components=Core::Widget: Gtk&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - OS X&lt;br /&gt;
|description= Gecko&#039;s OS X compatibility layer.&lt;br /&gt;
|owner=[mailto:mstange@themasta.com Markus Stange]&lt;br /&gt;
|peers=[mailto:joshmoz@gmail.com Josh Aas], [mailto:bgirard@mozilla.com Benoit Girard], [mailto:spohl@mozilla.com Stephen Pohl], [mailto:smichaud@pobox.com Steven Michaud]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/cocoa/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Cocoa&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Widget - Windows&lt;br /&gt;
|description=Windows widgets and desktop integration&lt;br /&gt;
|owner=[mailto:jmathies@mozilla.com Jim Mathies]&lt;br /&gt;
|peers=[mailto:blassey@mozilla.com Brad Lassey], [mailto:netzen@gmail.com Brian Bondy], [mailto:cbiesinger@gmail.com Christian Biesinger], [mailto:doug.turner@gmail.com Doug Turner], [mailto:neil@parkwaycc.co.uk Neil Rashbrook], [mailto:robarnold@cmu.edu Rob Arnold], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref], [mailto:vladimir@pobox.com Vladimir Vukicevic]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=widget/windows/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Widget: Win32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XBL&lt;br /&gt;
|description=eXtensible Binding Language&lt;br /&gt;
|owner=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|peers=[mailto:mrbkap@gmail.com Blake Kaplan], [mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=dom/xbl/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xbl/&lt;br /&gt;
|components=Core::XBL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XML&lt;br /&gt;
|description=XML in Mozilla, including XML, XHTML, Namespaces in XML, Associating Style Sheets with XML Documents, XML Linking and XML Extras. XML-related things that are not covered by more specific projects.&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking], [mailto:jst@mozilla.org Johnny Stenback]&lt;br /&gt;
|group=dev-tech-xml&lt;br /&gt;
|source_dirs=dom/xml/, extensions/xmlextras/, parser/expat/&lt;br /&gt;
|url=http://www.mozilla.org/newlayout/xml/&lt;br /&gt;
|components=Core::XML&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPApps&lt;br /&gt;
|description=Cross-Platform Applications, mostly Navigator front end and application shell.&lt;br /&gt;
|owner=[mailto:neil@parkwaycc.co.uk Neil Rashbrook]&lt;br /&gt;
|peers=[mailto:dean_tessman@hotmail.com Dean Tessman], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-apps-seamonkey&lt;br /&gt;
|source_dirs=xpfe/&lt;br /&gt;
|url=http://www.mozilla.org/xpapps/&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPCOM&lt;br /&gt;
|description=The cross-platform object model and core data structures.&lt;br /&gt;
|owner=[https://mozillians.org/en-US/u/froydnj/ Nathan Froyd]&lt;br /&gt;
|peers=[https://mozillians.org/en-US/u/dougt/ Doug Turner], [https://mozillians.org/en-US/u/bsmedberg/ Benjamin Smedberg]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=startupcache/, xpcom/%, xpcom/base/, xpcom/build/, xpcom/components/, xpcom/ds/, xpcom/glue/, xpcom/proxy/, xpcom/sample/, xpcom/stub/, xpcom/tests/, xpcom/threads/, xpcom/tools/, xpcom/windbgdlg/&lt;br /&gt;
|url=http://developer.mozilla.org/en/XPCOM&lt;br /&gt;
|components=Core::XPCOM&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPConnect&lt;br /&gt;
|description=Deep Magic&lt;br /&gt;
|owner=[mailto:bobbyholley@gmail.com Bobby Holley]&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jst@mozilla.org Johnny Stenback], [mailto:peterv@propagandism.org Peter Van der Beken], [mailto:mrbkap@gmail.com Blake Kaplan], [mailto:gkrizsanits@mozilla.com Gabor Krizsanits]&lt;br /&gt;
|peersemeritus=[mailto:gal@uci.edu Andreas Gal]&lt;br /&gt;
|group=&lt;br /&gt;
|source_dirs=js/xpconnect/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::XPConnect&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPIDL&lt;br /&gt;
|description=Cross-platform IDL compiler; produces .h C++ header files and .xpt runtime type description files from .idl interface description files.&lt;br /&gt;
|owner=[mailto:me@kylehuey.com Kyle Huey]&lt;br /&gt;
|peers=[mailto:shaver@mozilla.org Mike Shaver], [mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|group=dev-tech-xpcom&lt;br /&gt;
|source_dirs=xpcom/typelib/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xpidl&lt;br /&gt;
http://www.mozilla.org/scriptable&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPInstall&lt;br /&gt;
|description=&lt;br /&gt;
|owner=[mailto:dveditz@mozilla.com Dan Veditz]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg]&lt;br /&gt;
|group=dev-tech-xpinstall&lt;br /&gt;
|source_dirs=xpinstall/&lt;br /&gt;
|url=&lt;br /&gt;
|components=Core::Installer: XPInstall Engine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=xptcall&lt;br /&gt;
|description=XPTCall - platform-specific assembly for calling and implementing arbitrary XPCOM interfaces.&lt;br /&gt;
|owner=[mailto:timeless@mozdev.org Josh &#039;timeless&#039; Soref]&lt;br /&gt;
|peers=[mailto:benjamin@smedbergs.us Benjamin Smedberg], [mailto:shaver@mozilla.org Mike Shaver]&lt;br /&gt;
|group=dev-xpcom&lt;br /&gt;
|source_dirs=xpcom/reflect/xptcall/&lt;br /&gt;
|url=http://www.mozilla.org/scriptable/xptcall-faq.html&lt;br /&gt;
|components=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XPToolkit&lt;br /&gt;
|description=Cross-platform user interface toolkit&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:Jan.Varga@gmail.com Jan Varga]&lt;br /&gt;
|group=dev-tech-xul&lt;br /&gt;
|source_dirs=dom/xul/, layout/xul/&lt;br /&gt;
|url=http://www.mozilla.org/xpfe/&lt;br /&gt;
|components=Core::XP Toolkit/Widgets: Menus, Core::XP Toolkit/Widgets: XUL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XSLT Processor&lt;br /&gt;
|description=XSLT transformations processor&lt;br /&gt;
|owner=[mailto:peterv@propagandism.org Peter Van der Beken]&lt;br /&gt;
|peers=[mailto:axel@pike.org Axel Hecht], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xslt&lt;br /&gt;
|source_dirs=dom/xslt/&lt;br /&gt;
|url=http://www.mozilla.org/projects/xslt/, http://www.w3.org/TR/xslt.html&lt;br /&gt;
|components=Core::XSLT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=XTF&lt;br /&gt;
|description=eXtensible Tag Framework&lt;br /&gt;
|owner=&lt;br /&gt;
|peers=[mailto:alex@croczilla.com alex@croczilla.com], [mailto:bzbarsky@mit.edu Boris Zbarsky], [mailto:jonas@sicking.cc Jonas Sicking]&lt;br /&gt;
|group=dev-tech-xbl&lt;br /&gt;
|source_dirs=content/xtf/, layout/xtf/&lt;br /&gt;
|url=http://www.croczilla.com/bits_and_pieces/xtf/&lt;br /&gt;
|components=Core::XTF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing&lt;br /&gt;
|description=Cross platform sandboxing&lt;br /&gt;
|owner=[mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|peers=[mailto:bowen@mozilla.com Bob Owen], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:gDestuynder@mozilla.com Guillaume Destuynder], [mailto:bsmedberg@mozilla.com Benjamin Smedberg], [mailto:jld@mozilla.com Jed Davis]&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - Windows &lt;br /&gt;
|description=Sandboxing for the Windows platform &lt;br /&gt;
|owner=[mailto:bowen@mozilla.com Bob Owen]&lt;br /&gt;
|peers=[mailto:netzen@gmail.com Brian Bondy], [mailto:aklotz@mozilla.com Aaron Klotz], [https://mozillians.org/en-US/u/TimAbraldes Tim Abraldes], [mailto:jimm@mozilla.com Jim Mathies]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/win &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing - OSX &lt;br /&gt;
|description=Sandboxing for the OSX platform &lt;br /&gt;
|owner=[mailto:haftandilian@mozilla.com Haik Aftandilian]&lt;br /&gt;
|peers=&lt;br /&gt;
|group=dev-platform &lt;br /&gt;
|source_dirs=security/sandbox/mac &lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Sandboxing -  Linux &amp;amp; B2G&lt;br /&gt;
|description=Sandboxing for the Linux &amp;amp; B2G platforms&lt;br /&gt;
|owner=[mailto:jhector@mozilla.com Julian Hector]&lt;br /&gt;
|peers=[mailto:jld@mozilla.com Jed Davis] [mailto:gcp@mozilla.com Gian-Carlo Pascutto]&lt;br /&gt;
|group=dev-platform&lt;br /&gt;
|source_dirs=security/sandbox/linux&lt;br /&gt;
|url=https://wiki.mozilla.org/Security/Sandbox &lt;br /&gt;
|components=Core::Security: Process Sandboxing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Submodules===&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Build Config - Fennec&lt;br /&gt;
|description=Submodule of the build config covering Fennec&#039;s build system in mobile/android.&lt;br /&gt;
|owner=[mailto:gps@mozilla.com Gregory Szorc]&lt;br /&gt;
|peers=Same as Build Config plus [mailto:nalexander@mozilla.com Nicholas Alexander].&lt;br /&gt;
|group=dev-builds&lt;br /&gt;
|components=Core::Build Config&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Media&lt;br /&gt;
|description=Submodule of WebRTC responsible for access to media input devices (microphones, cameras, screen capture), as well as realtime audiovisual codecs and packetization.&lt;br /&gt;
|owner=[mailto:rjesup@mozilla.com Randell Jesup]&lt;br /&gt;
|peers=[mailto:ehugg@cisco.com Ethan Hugg],  [mailto:pkerr@mozilla.com Paul Kerr] &lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/webrtc, /dom/media/webrtc&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Audio/Video)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=WebRTC Signaling&lt;br /&gt;
|description=Submodule of WebRTC responsible for implementation of PeerConnection API, WebRTC identity, and SDP/JSEP handling&lt;br /&gt;
|owner=[mailto:bcampen@mozilla.com Byron Campen]&lt;br /&gt;
|peers=[mailto:ekr@mozilla.com Eric Rescorla], [mailto:abr@mozilla.com Adam Roach], [mailto:rjesup@mozilla.com Randell Jesup], [mailto:nohlmeier@mozilla.com Nils Ohlmeier]&lt;br /&gt;
|group=dev-media&lt;br /&gt;
|source_dirs=/media/peerconnection, /dom/media/peerconnection &#039;&#039;(note: file reorg underway)&#039;&#039;&lt;br /&gt;
|url=https://wiki.mozilla.org/Media/webrtc&lt;br /&gt;
|components=Core::WebRTC (Signaling)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unassigned Bugzilla Components===&lt;br /&gt;
&lt;br /&gt;
The following Bugzilla components in the Core project have not been assigned to a module (this list is not exhaustive):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Core::File Handling&lt;br /&gt;
Core::Find Backend&lt;br /&gt;
Core::Gecko Profiler&lt;br /&gt;
Core::General&lt;br /&gt;
Core::HTML: Form Submission&lt;br /&gt;
Core::History: Global&lt;br /&gt;
Core::Image Blocking&lt;br /&gt;
Core::JavaScript Debugging APIs&lt;br /&gt;
Core::Localization&lt;br /&gt;
Core::Nanojit&lt;br /&gt;
Core::Networking: Domain Lists&lt;br /&gt;
Core::Print Preview&lt;br /&gt;
Core::Printing: Output&lt;br /&gt;
Core::Printing: Setup&lt;br /&gt;
Core::Profile: BackEnd&lt;br /&gt;
Core::Profile: Migration&lt;br /&gt;
Core::Profile: Roaming&lt;br /&gt;
Core::QuickLaunch (AKA turbo mode)&lt;br /&gt;
Core::Rewriting and Analysis&lt;br /&gt;
Core::Selection&lt;br /&gt;
Core::Serializers&lt;br /&gt;
Core::Spelling checker&lt;br /&gt;
Core::Tracking&lt;br /&gt;
Core::Web Services&lt;br /&gt;
Core::WebDAV&lt;br /&gt;
Core::Widget: OS/2&lt;br /&gt;
Core::Widget: Photon&lt;br /&gt;
Core::X-remote&lt;br /&gt;
Core::XForms&lt;br /&gt;
Core::XUL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073446</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073446"/>
		<updated>2015-05-08T15:06:18Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Questions/concerns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Questions/concerns====&lt;br /&gt;
&lt;br /&gt;
* Interactions should be extended to allow to specify a control that triggers the action. The concept is described by InidieUI: you can use mouse, touchscreen, keyboard, voice control or a control element to invoke the action. Maybe Interactions should be renamed to Triggers to share terms with IndieUI.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the image of InideUI action/interaction concept.&lt;br /&gt;
&amp;lt;div style=&amp;quot;height: 254px; overflow: hidden;&amp;quot;&amp;gt;&lt;br /&gt;
http://www.w3.org/WAI/intro/iui-scroll.png&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively we could introduce relations between actions like &amp;quot;triggers&amp;quot; and &amp;quot;triggeredby&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* What about highlevel actions (uberactions), for example, &amp;quot;press&amp;quot; buttons means &amp;quot;send something somewhere&amp;quot;. This may be covered by label. Another example, selected listitem on the left changes a view on the right, &amp;quot;select&amp;quot; actions has meaning of &amp;quot;change view&amp;quot;. Or checkbox that enables/disables related controls, &amp;quot;check/uncheck&amp;quot; action means &amp;quot;enable/disable controls&amp;quot;. These examples correlates to controlledby/controllerfor relations, but the relations doesn&#039;t reveal type of control.&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make an optimization, the content provider has to know whether an accessibility consumer (like screen reader) is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073444</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073444"/>
		<updated>2015-05-08T14:54:33Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Interactions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Questions/concerns====&lt;br /&gt;
&lt;br /&gt;
* Interactions should be extended to allow to specify a control that triggers the action. The concept is described by InidieUI: you can use mouse, touchscreen, keyboard, voice control or a control element to invoke the action. Maybe Interactions should be renamed to Triggers to share terms with IndieUI.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the image of InideUI action/interaction concept.&lt;br /&gt;
http://www.w3.org/WAI/intro/iui-scroll.png&lt;br /&gt;
&lt;br /&gt;
Alternatively we could introduce relations between actions like &amp;quot;triggers&amp;quot; and &amp;quot;triggeredby&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* What about highlevel actions (uberactions), for example, &amp;quot;press&amp;quot; buttons means &amp;quot;send something somewhere&amp;quot;. This may be covered by label. Another example, selected listitem on the left changes a view on the right, &amp;quot;select&amp;quot; actions has meaning of &amp;quot;change view&amp;quot;. Or checkbox that enables/disables related controls, &amp;quot;check/uncheck&amp;quot; action means &amp;quot;enable/disable controls&amp;quot;. These examples correlates to controlledby/controllerfor relations, but the relations doesn&#039;t reveal type of control.&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make an optimization, the content provider has to know whether an accessibility consumer (like screen reader) is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073425</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073425"/>
		<updated>2015-05-08T13:08:14Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Interactions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* Interactions should be extended to allow to specify a control that triggers the action. The concept is described by InidieUI: you can use mouse, touchscreen, keyboard, voice control or a control element to invoke the action. Maybe Interactions should be renamed to Triggers to share terms with IndieUI.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the image of InideUI action/interaction concept.&lt;br /&gt;
http://www.w3.org/WAI/intro/iui-scroll.png&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make an optimization, the content provider has to know whether an accessibility consumer (like screen reader) is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073417</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073417"/>
		<updated>2015-05-08T12:46:16Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Sniffing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make an optimization, the content provider has to know whether an accessibility consumer (like screen reader) is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073415</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073415"/>
		<updated>2015-05-08T12:44:51Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Conflicts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073414</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073414"/>
		<updated>2015-05-08T12:44:31Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Conflicts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API, I tend to think that the author should be able to replace/remove native semantics if needed. This can ruin the web page but it gives the absolute control over the page content. A dangerous but quite powerful tool like atomic energy. ]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073412</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073412"/>
		<updated>2015-05-08T12:40:03Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Implied semantics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The idea is to help the author to keep the code less verbose as possible. If role implies a number of preset attributes or states then they are present on the accessible element by default, i.e. if the author didn&#039;t list them. For example, if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; role is selectable and focusable by default then the author doesn&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;focusable&amp;lt;/code&amp;gt; states when he describes a listitem source, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source1 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var source2 = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot;, &amp;quot;focusable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implied semantics is described by [[#SemanticsProviders|taxonomies]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073343</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073343"/>
		<updated>2015-05-07T19:49:11Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(AccessiblePos)&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text(CriteriaLiteral)&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073339</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073339"/>
		<updated>2015-05-07T19:37:22Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* States */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { },&lt;br /&gt;
&lt;br /&gt;
  checked: {&lt;br /&gt;
    exlusives: [ &amp;quot;mixed&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  mixed: {&lt;br /&gt;
    exlusives: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073337</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073337"/>
		<updated>2015-05-07T19:35:47Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* States */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString exclusives;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;exclusives&#039;&#039;&lt;br /&gt;
::Mutually exclusive states if applicable. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;multiline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    exlcusives: [ &amp;quot;singleline&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073326</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073326"/>
		<updated>2015-05-07T18:12:47Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; relations;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::List of relations supported by the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073325</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073325"/>
		<updated>2015-05-07T18:10:00Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Music sheet example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in terms of taxonomies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.import(&amp;quot;role&amp;quot;, {&lt;br /&gt;
  sheet: {&lt;br /&gt;
    description: &amp;quot;sheet&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;instrument&amp;quot;, &amp;quot;tempo&amp;quot;, &amp;quot;clef&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  note: {&lt;br /&gt;
    description: &amp;quot;note&amp;quot;,&lt;br /&gt;
    attributes: [ &amp;quot;key&amp;quot;, &amp;quot;alteration&amp;quot;, &amp;quot;octave&amp;quot;, &amp;quot;duration&amp;quot;, &amp;quot;effects&amp;quot; ],&lt;br /&gt;
    relations: [ &amp;quot;crescendo&amp;quot;, &amp;quot;diminuendo&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;attributes&amp;quot;, {&lt;br /&gt;
  instrument: {&lt;br /&gt;
    description: &amp;quot;instrument type&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  tempo: {&lt;br /&gt;
    description: &amp;quot;tempo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  clef: {&lt;br /&gt;
    description: &amp;quot;clef&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  key: {&lt;br /&gt;
    description: &amp;quot;key&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;H&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  alteration: {&lt;br /&gt;
    description: &amp;quot;alteration&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;flat&amp;quot;, &amp;quot;sharp&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  octave: {&lt;br /&gt;
    description: &amp;quot;octave&amp;quot;,&lt;br /&gt;
    values: [ &amp;quot;contra&amp;quot;, &amp;quot;great&amp;quot;, &amp;quot;small&amp;quot;, &amp;quot;1line&amp;quot;, &amp;quot;2line&amp;quot; ],&lt;br /&gt;
  },&lt;br /&gt;
  duration: {&lt;br /&gt;
    description: &amp;quot;duration&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  effects: {&lt;br /&gt;
    description: &amp;quot;effects&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
document.import(&amp;quot;relations&amp;quot;, {&lt;br /&gt;
  crescendo: {&lt;br /&gt;
    description: &amp;quot;crescendo&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  diminuendo: {&lt;br /&gt;
    description: &amp;quot;diminuendo&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073321</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073321"/>
		<updated>2015-05-07T17:44:19Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073320</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073320"/>
		<updated>2015-05-07T17:43:48Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Actions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073319</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073319"/>
		<updated>2015-05-07T17:42:13Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface ActionMap {&lt;br /&gt;
  void tweak(DOMString oldname, DOMString newname);&lt;br /&gt;
&lt;br /&gt;
  void add(DOMString name, object);&lt;br /&gt;
  void delete(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionMap ..&#039;&#039;tweak&#039;&#039;&lt;br /&gt;
::Toggles the action name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; actions;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon ..&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::List of supported actions. Actions from the list are exposed on the accessible element depending on states present on it. For example, if supported actions are &amp;quot;check&amp;quot; and &amp;quot;uncheck&amp;quot;, then &amp;quot;check&amp;quot; is exposed if the accessible element doesn&#039;t have &amp;quot;checked&amp;quot; state, otherwise &amp;quot;unchecked&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;checkbox&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checkbox: {&lt;br /&gt;
    description: &amp;quot;checkbox&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;checkable:default, &amp;quot;checked&amp;quot; ],&lt;br /&gt;
    actions: [ &amp;quot;check&amp;quot;, &amp;quot;uncheck&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073318</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073318"/>
		<updated>2015-05-07T17:30:34Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface ActionMap {&lt;br /&gt;
  void tweak(DOMString oldname, DOMString newname);&lt;br /&gt;
&lt;br /&gt;
  void add(DOMString name, object);&lt;br /&gt;
  void delete(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionMap ..&#039;&#039;tweak&#039;&#039;&lt;br /&gt;
::Toggles the action name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary ActionTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  DOMString dual;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;dual&#039;&#039;&lt;br /&gt;
::Dual action taxon. When action is invoked, it is switched to its dual action if applicable.&lt;br /&gt;
&lt;br /&gt;
ActionTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Implied states. When action is invoked, states of dual action are cleared, this action states are set.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  check: {&lt;br /&gt;
    description: &amp;quot;check&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    states: [ &amp;quot;checked&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  uncheck: {&lt;br /&gt;
    description: &amp;quot;uncheck&amp;quot;,&lt;br /&gt;
    dual: &amp;quot;check&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073316</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073316"/>
		<updated>2015-05-07T17:19:44Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionMap|ActionMap]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====ActionMap====&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionMap&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface ActionMap {&lt;br /&gt;
  void tweak(DOMString oldname, DOMString newname);&lt;br /&gt;
&lt;br /&gt;
  void add(DOMString name, object);&lt;br /&gt;
  void delete(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionMap ..&#039;&#039;tweak&#039;&#039;&lt;br /&gt;
::Toggles the action name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073315</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073315"/>
		<updated>2015-05-07T17:18:10Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Relations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface ActionMap {&lt;br /&gt;
  void tweak(DOMString oldname, DOMString newname);&lt;br /&gt;
&lt;br /&gt;
  void add(DOMString name, object);&lt;br /&gt;
  void delete(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActionMap ..&#039;&#039;tweak&#039;&#039;&lt;br /&gt;
::Toggles the action name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073312</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073312"/>
		<updated>2015-05-07T16:55:52Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Caret and selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073311</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073311"/>
		<updated>2015-05-07T16:55:17Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString text(AccessiblePos pos);&lt;br /&gt;
  DOMString text(CriteriaLiteral criteria);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Returns the text at the position complying the given criteria. See [[#Criteria|criteria]] for options.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a) &lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var startPos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, &amp;quot;line&amp;quot;);&lt;br /&gt;
var text = startPos.text(startPos, endPos);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or same effect by using criteria literal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(a)&lt;br /&gt;
  { return a.role == &amp;quot;paragraph&amp;quot; ? &amp;quot;being&amp;quot; : &amp;quot;next&amp;quot; };&lt;br /&gt;
var pos = new A11ePos(document).move(&amp;quot;first&amp;quot;, criteria);&lt;br /&gt;
var text = pos.text(&amp;quot;line&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073310</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073310"/>
		<updated>2015-05-07T16:46:00Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Accessible Position */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? move(Where where, Criteria);&lt;br /&gt;
  AccessiblePos? search(Where where, Criteria);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] section for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.text(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script above generates the log &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of the match.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a criteria term or offset(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and given offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria. If it cannot be moved withing current accessible then it reenters with next accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next line within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073152</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073152"/>
		<updated>2015-05-06T20:45:51Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Move through the content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039; (&#039;&#039;Where&#039;&#039;, &#039;&#039;Criteria&#039;&#039;)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;criteria&#039;&#039; of &#039;&#039;Criteria&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Where to search=====&lt;br /&gt;
&lt;br /&gt;
The search area and the way accessible elements are traversed are defined by &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument. It defines whether traversal is perfromed by accessible tree hierarchy or by layout on the screen, and whether the traversal is relative of the current position or relative of the root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;first&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;last&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria=====&lt;br /&gt;
&lt;br /&gt;
Criteria can be either a literal describing how the position should be moved or a matching function called for every traversed accessible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef CriteriaLiteral or CriteriaFunc Criteria;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum CriteriaLiteral {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaLiteral .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&lt;br /&gt;
CriteriaLiteral .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;begin&amp;quot;, p), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, &amp;quot;word&amp;quot;)) {&lt;br /&gt;
  console.log(pos2.textInBetween(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the log is &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Traverse by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples #3.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback CriteriaFunc = CriteriaLiteral or Offset or &amp;quot;next&amp;quot; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CriteriaFunc&lt;br /&gt;
::A criteria function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;next&amp;quot; is returned then criteria function is reentered with next traversed accessible. If offset is given then traversing is stopped, the accessible position is moved to the traversed accessible element and returned offset. If criteria literal is returned then the accessible position is moved to the position complying the criteria.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;line&amp;quot;;&lt;br /&gt;
// how to land on first line and then traverse all of them one by one?&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073035</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1073035"/>
		<updated>2015-05-06T19:44:36Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Move through the content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Change the position====&lt;br /&gt;
&lt;br /&gt;
There is a bunch of methods to change accessible position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself or null if not succeeded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
Accessible position can be moved through the content by criteria.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Criteria)&lt;br /&gt;
::Move the accessible position to the content complying with criteria.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself if succeeded, otherwise null.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Criteria)&lt;br /&gt;
::Search for content of the given criteria relative the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance if succeeded, otherwise null.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Search area=====&lt;br /&gt;
&lt;br /&gt;
Methods traverse the accessible elements and runs the criteria function against each traversee for a match. The traversal is performed either by accessible tree hierarchy or by accessible elements layout on the screen what depends on &amp;lt;code&amp;gt;Where&amp;lt;/code&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where {&lt;br /&gt;
  &amp;quot;forward&amp;quot;,&lt;br /&gt;
  &amp;quot;backward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
  &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
  &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
  &amp;quot;tolast&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;left&amp;quot;,&lt;br /&gt;
  &amp;quot;right&amp;quot;,&lt;br /&gt;
  &amp;quot;up&amp;quot;,&lt;br /&gt;
  &amp;quot;down&amp;quot;,&lt;br /&gt;
  &amp;quot;above&amp;quot;,&lt;br /&gt;
  &amp;quot;under&amp;quot;,&lt;br /&gt;
  &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function criteria(el) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, criteria);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, criteria);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Criteria function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;afterbegin&amp;quot;), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return &amp;quot;word&amp;quot;; })) {&lt;br /&gt;
  console.log(pos2.textInBetween(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the log is &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;It &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;beforeend&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072748</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072748"/>
		<updated>2015-05-06T19:19:34Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Accessible Position */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&lt;br /&gt;
Construction by accessible element and offset relative it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The offset may be either a number, a numeric mapping of caret position in the content, or a literal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;begin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;end&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;begin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;end&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Input widget.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; value=&amp;quot;Hello&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// Position is at the control&lt;br /&gt;
var p = new A11ePos(input, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 0 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Position is in the control text at 5 offset.&lt;br /&gt;
p = new A11ePos(input, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Image inside a paragraph.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;I &amp;lt;img id=&amp;quot;img&amp;quot; src=&amp;quot;love.png&amp;quot; alt=&amp;quot;love&amp;quot;&amp;gt; you&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var img = document.getElementById(&amp;quot;img&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position is right before the image, at 2 offset relative the paragraph.&lt;br /&gt;
var p = new A11ePos(img, &amp;quot;before&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is right after the image, at 3 offset relative the paragraph.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;after&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is at the image, no offset relative the paragraph is applicable.&lt;br /&gt;
p = new A11ePos(img, &amp;quot;at&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;begin&amp;quot;);&lt;br /&gt;
p = new A11ePos(img, &amp;quot;end&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Table.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;table&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;cell&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var table = document.getElementById(&amp;quot;table&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
// The position at the table.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;at&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;begin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, after the row.&lt;br /&gt;
var p = new A11ePos(table, &amp;quot;end&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The position is in the table, before the row, numeric offset is ignored.&lt;br /&gt;
var p = new A11ePos(table, 1);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a point on the screen. See [[#Hit_testing|hit testing]] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Construction from a DOM node and offset relative it. See [[#Caret_and_selection|selection]] for examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy constructor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;afterbegin&amp;quot;), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return &amp;quot;word&amp;quot;; })) {&lt;br /&gt;
  console.log(pos2.textInBetween(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the log is &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;It &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;beforeend&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072726</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072726"/>
		<updated>2015-05-06T18:30:23Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Matching function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Traverse a paragraph by words.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var p = document.getElementById(&amp;quot;p&amp;quot;).a11ement;&lt;br /&gt;
var pos1 = new A11ePos(p, &amp;quot;afterbegin&amp;quot;), pos2 = null;&lt;br /&gt;
while (pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return &amp;quot;word&amp;quot;; })) {&lt;br /&gt;
  console.log(pos2.textInBetween(pos1));&lt;br /&gt;
  pos1 = pos2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mozilla is a &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;free-software&amp;lt;/a&amp;gt; community which&lt;br /&gt;
produces the &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Firefox web browser&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mo&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;zilla&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the log is &amp;quot;Mozilla &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;a &amp;quot;, &amp;quot;free-&amp;quot;, &amp;quot;software &amp;quot;, &amp;quot;community&amp;quot;, &amp;quot;which &amp;quot;, &amp;quot;produces &amp;quot;, &amp;quot;the &amp;quot;, &amp;quot;Firefox &amp;quot;, &amp;quot;web &amp;quot;, &amp;quot;browser.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The log is &amp;quot;It &amp;quot;, &amp;quot;is &amp;quot;, &amp;quot;Mozilla&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;beforeend&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072610</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072610"/>
		<updated>2015-05-06T15:40:30Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072609</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072609"/>
		<updated>2015-05-06T15:40:03Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Questions/concerns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072608</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072608"/>
		<updated>2015-05-06T15:39:29Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072607</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072607"/>
		<updated>2015-05-06T15:38:59Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Content traversal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072570</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072570"/>
		<updated>2015-05-06T13:56:25Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Taxonomy types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each taxonomy is described means of its own interface which is used to define the hierarchy and interconnections between taxonomies. If taxon refers to taxa of other taxonomy type then a string describing the reference may be in form of &amp;quot;taxon:modifier&amp;quot;, where taxon is a name of related taxon and modifier is an extra information about how the taxa are interconnected. For example, role taxon may be connected to &amp;quot;live&amp;quot; taxon of attributes taxonomy by placing &amp;quot;live:assertive&amp;quot; value in &amp;lt;code&amp;gt;attributes&amp;lt;/code&amp;gt; field which means that the role supports &amp;quot;live&amp;quot; object attribute and its default value is &amp;quot;assertive&amp;quot; on it.&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxon {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxon .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role. Optional modifier is &amp;quot;default&amp;quot; which points out that the state is exposed on the role until explicitly specified otherwise. See [[#Implied_semantics|implied semantics]].&lt;br /&gt;
&lt;br /&gt;
RoleTaxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes supported by the role. Default value of the attribute may be specified as modifier. For example, &amp;quot;live:polite&amp;quot; points out that &amp;quot;live&amp;quot; object attribute has &amp;quot;polite&amp;quot; value by default. If default value is not specified then it&#039;s taken from referred attribute taxon description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;textbox&amp;lt;/code&amp;gt; role&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  widget: { }&lt;br /&gt;
  input: {&lt;br /&gt;
    parents: [ &amp;quot;widget&amp;quot; ],&lt;br /&gt;
    states: [ &amp;quot;focusable:default&amp;quot;, &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  textbox: {&lt;br /&gt;
    description: &amp;quot;text field&amp;quot;,&lt;br /&gt;
    parents: [ &amp;quot;input&amp;quot; ],&lt;br /&gt;
    states: [&lt;br /&gt;
      &amp;quot;singleline:default&amp;quot;, &amp;quot;multiline&amp;quot;,&lt;br /&gt;
      &amp;quot;editable&amp;quot;, &amp;quot;readonly&amp;quot;,&lt;br /&gt;
      &amp;quot;required&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    attributes: [ &amp;quot;autocomplete&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. ARIA &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  region: {&lt;br /&gt;
  },&lt;br /&gt;
  log: {&lt;br /&gt;
    parents: [ &amp;quot;region&amp;quot; ],&lt;br /&gt;
    attributes: [ &amp;quot;live:polite&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; dependents;&lt;br /&gt;
  DOMString opposite;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized taxa description.&lt;br /&gt;
&lt;br /&gt;
StateTaxon .&#039;&#039;dependents&#039;&#039;&lt;br /&gt;
::List of all dependent states. For example, &amp;quot;focused&amp;quot; state always accompanied by &amp;quot;focusable&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
StateTaxon ..&#039;&#039;opposite&#039;&#039;&lt;br /&gt;
::An opposite state if any. Opposite state are mutually exclusive. For example, if &amp;quot;vertical&amp;quot; state is applied then &amp;quot;horizontal&amp;quot; is not and vice versa.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  focusable: {&lt;br /&gt;
    dependents: [ &amp;quot;focused&amp;quot; ]&lt;br /&gt;
  },&lt;br /&gt;
  focused: { },&lt;br /&gt;
  singleline: {&lt;br /&gt;
    opposite: &amp;quot;multiline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  multiline: {&lt;br /&gt;
    opposite: &amp;quot;singleline&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  readonly: { },&lt;br /&gt;
  editable: { },&lt;br /&gt;
  required: { }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeTaxon {&lt;br /&gt;
  DOMString description;&lt;br /&gt;
  sequence&amp;lt;DOMString&amp;gt; values;&lt;br /&gt;
  DOMString default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeTaxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized description of the taxon&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;values&#039;&#039;&lt;br /&gt;
::List of all possible values of the attrbiute&lt;br /&gt;
&lt;br /&gt;
AttributeTaxon .&#039;&#039;default&#039;&#039;&lt;br /&gt;
::Default attribute value. Takes a place if role taxa pointing to it doesn&#039;t have own default value of it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  autocomplete: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;list&amp;quot;, &amp;quot;inline&amp;quot;, &amp;quot;both&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  live: {&lt;br /&gt;
    values: [ &amp;quot;none&amp;quot;, &amp;quot;polite&amp;quot;, &amp;quot;assertive&amp;quot; ],&lt;br /&gt;
    default: &amp;quot;none&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072542</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072542"/>
		<updated>2015-05-06T12:10:54Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Taxonomies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.a11ement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072361</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072361"/>
		<updated>2015-05-05T20:03:45Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Canvas hit regions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.element.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.element.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  element: null // set by the browser&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072360</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072360"/>
		<updated>2015-05-05T20:02:44Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Proto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Inheritance====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;element&#039;&#039;&lt;br /&gt;
::Refers to the accessible element implementation as there were no accessible source attached to it. Set by the browser when the accessible source is attached to the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.element.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector));&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  element: null,&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072359</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072359"/>
		<updated>2015-05-05T20:00:48Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Feedback notifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.proto.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector);&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
Accessible element may be notified of any kind of event, including about property change when managed by connected source object. When notified the browser may fire accessible events and update its cache if necessary. Decision whether to notify the browser or not should be based on the accessible events model. In other words if a property change in native markup causes accessible event then it&#039;s quite likely the event is expected for similar accessible source change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::eventType of DOMString&lt;br /&gt;
::::The event type to fire.&lt;br /&gt;
:::attrs&lt;br /&gt;
::::Attributes describing the event. See [[#Event_types|event types]] for attributes variety.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
function onfocus(aEvent) {&lt;br /&gt;
  // Change accessible properties when element is focused.&lt;br /&gt;
  // The change requires accessible events.&lt;br /&gt;
  aEvent.target.accessibleSource = listboxSource;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072348</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072348"/>
		<updated>2015-05-05T18:51:39Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Proto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Lazy extension of accessible relations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  get relations() {&lt;br /&gt;
    var r = this.proto.relations;&lt;br /&gt;
    r.add(&amp;quot;labelledby&amp;quot;, document.querySelector(this.selector);&lt;br /&gt;
    return r;&lt;br /&gt;
  },&lt;br /&gt;
  selector: &amp;quot;&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
document.getElementById(&amp;quot;button&amp;quot;).accessibleSource = source;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072343</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072343"/>
		<updated>2015-05-05T18:21:07Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Multiprocessing==&lt;br /&gt;
&lt;br /&gt;
Accessible tree is scoped to a process, i.e. you can have seamless accessible tree between all document frames until it violates security policy. In case of multiprcess frames you have to use standard mechanism to communicate between processes.&lt;br /&gt;
&lt;br /&gt;
When the virtual cursor reaches a frame start or end and it was attempted to move it further then message is sent to a process where the virtual cursor would go in case of single process.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
* what messaging mechanism should be used&lt;br /&gt;
* should it be allowed to move from iframe to parent document?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072327</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072327"/>
		<updated>2015-05-05T17:40:20Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Extend the semantic via accessible source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #5. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #6. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072324</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072324"/>
		<updated>2015-05-05T17:38:41Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #4. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #5. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072323</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072323"/>
		<updated>2015-05-05T17:32:31Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* AttributeMap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the object properties matches to the object attributes.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all of the object properties matches to the object attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each property of the object is a string or an array of strings. If array of strings is given then the object attribute is expected to have any of given values, empty array means the attribute value doesn&#039;t matter for match. String value and null values are treated as single element array or empty array correspondingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var attrs = {&lt;br /&gt;
  live: [ &amp;quot;assertive&amp;quot;, &amp;quot;polite&amp;quot; ],&lt;br /&gt;
  relevant: &amp;quot;show&amp;quot;,&lt;br /&gt;
  busy: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var matched = accEl.hasAllOf(attrs);&lt;br /&gt;
// Matches if the ccessible element has &amp;quot;live&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;assertive&amp;quot; or &amp;quot;polite&amp;quot; values, has &amp;quot;relevant&amp;quot; object attribute of&lt;br /&gt;
// &amp;quot;show&amp;quot; value, and it has &amp;quot;busy&amp;quot; attribute.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Process autocomplete.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).a11ement;&lt;br /&gt;
&lt;br /&gt;
var checkObj = { autocomplete: [ &amp;quot;list&amp;quot;, &amp;quot;both&amp;quot; ] };&lt;br /&gt;
if (accEl.attributes.hasAllOf(checkObj)) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Alternatively you can do&lt;br /&gt;
var autocomplete = accEl.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  doAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #4. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #5. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072244</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072244"/>
		<updated>2015-05-05T14:03:13Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Accessible element */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the given object properties and its non null value matches a { name, value } pair from the map. If a null value property value matches a map name then value is ignored and is not part of the match.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all properties of the given object and their values match name/value pairs from the map. If matched property value is null then value is ignored and is not part of the match.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script processing list autocomplete.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accElm = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
var autocomplete = accElm.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  processListAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns supported by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #4. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #5. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072243</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072243"/>
		<updated>2015-05-05T14:00:03Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Extend the semantic via accessible source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the given object properties and its non null value matches a { name, value } pair from the map. If a null value property value matches a map name then value is ignored and is not part of the match.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all properties of the given object and their values match name/value pairs from the map. If matched property value is null then value is ignored and is not part of the match.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script processing list autocomplete.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accElm = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
var autocomplete = accElm.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  processListAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; patterns;&lt;br /&gt;
  object toPattern(DOMString);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(Offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Patterns====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;patterns&#039;&#039;&lt;br /&gt;
::Returns a list of all patterns implemented by the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;toPattern&#039;&#039;&lt;br /&gt;
::Returns an object for the given pattern. If the method is not provided then the source object has to implemented itself all claimed patterns.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #4. Implement patterns.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var slider = {&lt;br /&gt;
  role: &amp;quot;slider&amp;quot;,&lt;br /&gt;
  patterns: [ &amp;quot;value&amp;quot; ],&lt;br /&gt;
  toPattern: function(aName) {&lt;br /&gt;
    return aName == &amp;quot;value&amp;quot; ? this : null;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  min: 0,&lt;br /&gt;
  max: 100,&lt;br /&gt;
  value: 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #4. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #5. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072047</id>
		<title>Accessibility/WebAccessibilityAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Accessibility/WebAccessibilityAPI&amp;diff=1072047"/>
		<updated>2015-05-04T18:57:16Z</updated>

		<summary type="html">&lt;p&gt;Surkov.alexander: /* Questions/concerns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
There&#039;s number of objectives on the web to improve accessibility and usability support. Web applications want to provide special support for their users, helping them navigate and perceive the content. The browser has a number of add-ons serving to improve accessibility support, for example, the app letting to navigate landmarks on the web page. These tasks require accessibility API similar to what desktop assistive technologies have.&lt;br /&gt;
&lt;br /&gt;
Web accessibility API also allows for in-browser automated accessibility testing of web content, i.e. helpful for checking that HTML and other standards in the browser are accessible to all users.&lt;br /&gt;
&lt;br /&gt;
On the other hand there&#039;s a growing need for making graphical content accessible. These are charts, graphs and other various visual forms that are drawn using HTML canvas or SVG. There&#039;s also a tendency to use HTML canvas element in place of DOM because of performance matter, here&#039;s an [http://engineering.flipboard.com/2015/02/mobile-web/ example]. All markup in the example is defined in JavaScript and there is a need for a non-DOM accessibility solution to make the content accessible.&lt;br /&gt;
&lt;br /&gt;
=Web accessibility API=&lt;br /&gt;
&lt;br /&gt;
The API provides bunch of interfaces that are used to express the web content the way the assistive technologies (AT) knows how to deal with. In other words each piece of semantically meaningful content has associated accessible element the AT operates at. The interfaces allow to receive accessible element properties, traverse the hierarchy and interact with content. &lt;br /&gt;
&lt;br /&gt;
Also the API provides a way to extend existing semantics of the markup and add new semantics for inaccessible content like canvas drawings.&lt;br /&gt;
&lt;br /&gt;
==Accessible element==&lt;br /&gt;
&lt;br /&gt;
This is a basic interface providing an access to the accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleElement {&lt;br /&gt;
  attribute DOMString role;&lt;br /&gt;
&lt;br /&gt;
  attribute DOMString name;&lt;br /&gt;
  attribute DOMString description;&lt;br /&gt;
  attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute StateSet states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute Object toPattern(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
  AccessibleElement? relativeOf(DOMString type);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute ActionMap actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
  readonly attribute InteractionMap intreactions;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccesibleElement? parent;&lt;br /&gt;
  readonly attribute AccesibleElement? firstChild;&lt;br /&gt;
  readonly attribute AccesibleElement? lastChild;&lt;br /&gt;
  readonly attribute AccesibleElement? nextSibling;&lt;br /&gt;
  readonly attribute AccesibleElement? previousSibling;&lt;br /&gt;
  readonly attribute AccessibleChildren children;&lt;br /&gt;
&lt;br /&gt;
  readony attribute Node? DOMNode;&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Node interface extension===&lt;br /&gt;
Accessible element can be requested from a DOM node if the DOM node is accessible, i.e. it expresses meaningful semantics to the assistive technology.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  AccessibleElement? accessibleElement;&lt;br /&gt;
&lt;br /&gt;
  A11eElement? a11ement; // nicer and shorter verison? // another version: accElement, accEl&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Role===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;role&#039;&#039;&lt;br /&gt;
::Returns accessible role as a string. Examples: &amp;quot;button&amp;quot;, &amp;quot;menu&amp;quot;, &amp;quot;textfield&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Returns accessible name.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Returns accessible description.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::Returns accessible value if applicable.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;States&amp;quot;&amp;gt;&lt;br /&gt;
===States===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::Returns a [[#States|StateSet]] live object for all accessible states of an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accessible states of an accessible element are presented by the &amp;lt;code&amp;gt;StateSet&amp;lt;/code&amp;gt; object. It is a live object, i.e. if the states of the accessible element change then the object reflects that. Implementation is not required to compute any state until requested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface StateSet {&lt;br /&gt;
  readonly setlike&amp;lt;DOMString&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(DOMString ... states);&lt;br /&gt;
  boolean hasAllOf(DOMString ... states);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Returns true if any of the given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Returns true if all given states are present on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script that logs to console all accessible element states.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accEl = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
for (let state of accElm.states) {&lt;br /&gt;
  console.log(state);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
&lt;br /&gt;
The accessible element may support a number of attributes to express the semantics that cannot be described by base properties of an accessible element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeMap|AttributeMap]] live object for all object attributes exposed on the accessible element. If accessible element attributes are changed then the object reflects the actual state of attributes. The implementation is not required to pre-compute any of the attributes.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AttributeMap&amp;quot;&amp;gt;&lt;br /&gt;
====AttributeMap====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AttributeMap&amp;lt;/code&amp;gt; is an interface aimed to work with {name, value} pairs of accessible attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AttributeMap {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, any&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(Object map); // Needs more work&lt;br /&gt;
  boolean hasAllOf(Object map); // Needs more work&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AttributeSet .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of the given object properties and its non null value matches a { name, value } pair from the map. If a null value property value matches a map name then value is ignored and is not part of the match.&lt;br /&gt;
&lt;br /&gt;
AttributeSet .&#039;&#039;hasAllOf&#039;&#039;&lt;br /&gt;
::Return true if all properties of the given object and their values match name/value pairs from the map. If matched property value is null then value is ignored and is not part of the match.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of a script processing list autocomplete.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var accElm = document.getElementById(&amp;quot;foo&amp;quot;).accessibleElement;&lt;br /&gt;
var autocomplete = accElm.attributes.get(&amp;quot;autocomplete&amp;quot;);&lt;br /&gt;
if ([&amp;quot;list&amp;quot;, &amp;quot;both&amp;quot;].indexOf(autocomplete) != -1) {&lt;br /&gt;
  processListAutocomplete();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attribute list====&lt;br /&gt;
&lt;br /&gt;
Set of exposed attributes depends on semantics of the element. As an example, typical attributes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DOMString &#039;&#039;autocomplete&#039;&#039;;&lt;br /&gt;
::Exposed on text fields. Values are &#039;&#039;list&#039;&#039;, &#039;&#039;none&#039;&#039;, &#039;&#039;inline&#039;&#039;, &#039;&#039;both&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;live&#039;&#039;;&lt;br /&gt;
::Points that the accessible is live region. Values are &#039;&#039;assertive&#039;&#039; and &#039;&#039;polite&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
DOMString &#039;&#039;relevant&#039;&#039;;&lt;br /&gt;
::Lists all notifications that qualifies for live region.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Patterns===&lt;br /&gt;
&lt;br /&gt;
A pattern is a collection of attributes or methods that expresses an accessible element semantics and compliments what the AccessibleElement interface provides. The patterns concept is quite similar to attributes but tends to be more powerful. Basically, it is an alternative implementation of COM&#039;s queryInterface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Object .&#039;&#039;toPattern&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns an object for the pattern of given type if supported by an accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[#Patters|patterns section]] for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement? .&#039;&#039;relativeOf&#039;&#039;(DOMString type)&lt;br /&gt;
::Returns related accessible element of the given relation type. If relation points to multiple accessible elements, the first one is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Returns a map of relation types as keys and related accessible elements as values.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface RelationMap {&lt;br /&gt;
  maplike&amp;lt;DOMString, sequence&amp;lt;AccessibleElement&amp;gt;&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relation types====&lt;br /&gt;
&lt;br /&gt;
This is a typical list of relation types that may be exposed by an accessible element. Note, the accessible element may support custom relations as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;labelfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is labelled by this accessible element.&lt;br /&gt;
&#039;&#039;labelledby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a label for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;descriptionfor&#039;&#039;&lt;br /&gt;
::Referred accessible element is an element that is described by this accessible element.&lt;br /&gt;
&#039;&#039;describedby&#039;&#039;&lt;br /&gt;
::Referred accessible element is a description for this accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;widget&#039;&#039;&lt;br /&gt;
::Return a widget the item belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Return a logical parent of the item. This relation may be useful for ARIA structures if the browser doesn&#039;t convert DOM flat structure into accessible hierarchical tree.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
Console logging of all headers of the grid cell and name of the grid itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  var headers = cell.relations.get(&amp;quot;labelledby&amp;quot;);&lt;br /&gt;
  for (let header of headers) {&lt;br /&gt;
    console.log(header.role, header.name);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  var grid = cell.relativeOf(&amp;quot;widget&amp;quot;);&lt;br /&gt;
  console.log(grid.name);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Actions===&lt;br /&gt;
&lt;br /&gt;
An accessible element may support actions that can be invoked on it. For example, &amp;lt;code&amp;gt;jump&amp;lt;/code&amp;gt; on a link or &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; on a button, or it can be generic purpose actions like &amp;lt;code&amp;gt;scroll&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt;. Certain accessible actions may take optional parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Returns a [[#ActionSet|ActionSet]] object of actions exposed by the accessible element. The returned object is not live, i.e. it is not updated if the accessible element actions change.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;activate&#039;&#039;(in DOMString name, in optional any param)&lt;br /&gt;
::Invokes the accessible action.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;name&#039;&#039;&lt;br /&gt;
::::action name to invoke&lt;br /&gt;
:::&#039;&#039;param&#039;&#039;&lt;br /&gt;
::::used to provide extra context for the action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Performs the given accessible action on the accessible element.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Action list====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Exposed on accessible elements that may be activated. Accessible elements may use other names for this action to emphasize the semantics they expose. For example, &#039;&#039;jump&#039;&#039; on links, &#039;&#039;press&#039;&#039; on buttons, &#039;&#039;check&#039;&#039; and &#039;&#039;uncheck&#039;&#039; on checkboxes. Accessible element may provide more than one action. For example, tree item can provide &#039;&#039;select&#039;&#039;/&#039;&#039;unselect&#039;&#039; as its primary action and &#039;&#039;expand&#039;&#039;/&#039;&#039;collapse&#039;&#039; as secondary. Tree column may implement &#039;&#039;sort&#039;&#039; action.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;focus&#039;&#039;&lt;br /&gt;
::Focus on an accessible element. May be different from &amp;quot;activate&amp;quot; action, for example, in case of buttons where &amp;quot;activate&amp;quot; means press.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;scroll&#039;&#039;&lt;br /&gt;
::Scrolls an accessible element into view, optionally takes coordinates relative the element to scroll the view to&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;delta&#039;&#039; of &#039;&#039;ScrollDelta&#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;drag&#039;&#039; and &#039;&#039;drop&#039;&#039;&lt;br /&gt;
::Used to start dragging and dropping the content related to the accessible element the action is invoked on.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;zoomin&#039;&#039; / &#039;&#039;zoomout&#039;&#039;&lt;br /&gt;
::Zooms in/out the content corresponding the accessible the action is invoked on.&lt;br /&gt;
::Parameter:&lt;br /&gt;
:::&#039;&#039;ratio&#039;&#039; of double, optional&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&#039;&#039;undo&#039;&#039; / &#039;&#039;redo&#039;&#039;&lt;br /&gt;
::Performs clipboard operations on the accessible element of the editable content.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====ScrollDelta param=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
directory ScrollDelta {&lt;br /&gt;
  int x;&lt;br /&gt;
  int y;&lt;br /&gt;
  int z;&lt;br /&gt;
  DOMString mode;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ScrollDelta&amp;lt;/code&amp;gt; structure describes a scroll change within the accessible element, the scroll change can be expressed in different units, for example, it can be in pixels or in pages. The accessible element may provide its custom set of supported modes which has to be described in [[#Taxonomy|taxonomy]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;x&#039;&#039;, .&#039;&#039;y&#039;&#039;, .&#039;&#039;z&#039;&#039;&lt;br /&gt;
::3d coordinates in the units provided by &#039;&#039;mode&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; might be optional depending on the unit.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ScrollDelta .&#039;&#039;mode&#039;&#039;&lt;br /&gt;
::A unit the coordinates are measured in. Can be on of the following values:&lt;br /&gt;
:::&#039;&#039;pixel&#039;&#039; - &#039;&#039;x&#039;&#039;, &#039;&#039;y&#039;&#039; and &#039;&#039;z&#039;&#039; (optional) specifies how many pixles to scroll (2d or 3d)&lt;br /&gt;
:::&#039;&#039;line&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many lines to scroll&lt;br /&gt;
:::&#039;&#039;paragraph&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many paragraphs to scroll&lt;br /&gt;
:::&#039;&#039;page&#039;&#039; - &#039;&#039;x&#039;&#039; specifies how many pages to scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ActionSet&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ActionSet====&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible actions are presented by &amp;lt;code&amp;gt;ActionSet&amp;lt;/code&amp;gt; map like object of pairs { action name, action object }.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface ActionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Action&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each action is presented by &amp;lt;code&amp;gt;Action&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Action {&lt;br /&gt;
  stingifier readonly attribute name;&lt;br /&gt;
  readonly attribute description;&lt;br /&gt;
  readonly InteractionSet interactions(optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Action .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Action name&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized action description&lt;br /&gt;
&lt;br /&gt;
Action .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Set of interactions (like keyboard shortcuts or mouse gestures) to invoke the action.&lt;br /&gt;
:::Parameters&lt;br /&gt;
::::device (optional)&lt;br /&gt;
:::::device name like &#039;keyboard&#039; or &#039;touchscreen&#039; the interactions should be returned for.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of script announcing available actions on the accessible element.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var set = accElm.actions;&lt;br /&gt;
if (set.size() == 0) {&lt;br /&gt;
  say(&amp;quot;no actions on accessible element&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
  say(&amp;quot;accessible element has &amp;quot; + set.size() + &amp;quot; actions&amp;quot;);&lt;br /&gt;
  set.forEach(action =&amp;gt; say(action.description));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Interactions====&lt;br /&gt;
&lt;br /&gt;
A widget may support actions that can be invoked through variety of devices or by AT like screen readers. The way the action is triggered by the user is described by the interaction. Examples of user interactions are &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt;, a mouse gesture to toggle a switch control; &amp;lt;code&amp;gt;space&amp;lt;/code&amp;gt;, a key to toggle a checkbox. Access keys (&amp;lt;code&amp;gt;alt+letter&amp;lt;/code&amp;gt;) and keyboard shortcuts (&amp;lt;code&amp;gt;ctrl+shift+letter&amp;lt;/code&amp;gt;) used to activate the widgets are also examples of interactions. Complex widgets like grid control may support several actions, for example &amp;lt;code&amp;gt;ctrl+A&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;selectall&amp;lt;/code&amp;gt; action, &amp;lt;code&amp;gt;ArrowDown/ArrowUp&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movedown/moveup&amp;lt;/code&amp;gt; actions, &amp;lt;code&amp;gt;ArrowRight/ArrowLeft&amp;lt;/code&amp;gt; keys for &amp;lt;code&amp;gt;movenext/moveprev&amp;lt;/code&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
The AT may need to know the used shortcuts to avoid possible conflicts or to supply a native way to invoke the action. For example, if presentation supports &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; gesture to navigate the slides then the AT can announce this info for the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;interactions&#039;&#039;&lt;br /&gt;
::Return an &#039;&#039;InteractionSet&#039;&#039; object describing all interactions that can be performed with the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface InteractionSet {&lt;br /&gt;
  readonly maplike&amp;lt;DOMString, Interaction&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
  boolean hasAnyOf(sequence&amp;lt;DOMString&amp;gt; interactions);&lt;br /&gt;
  readonly attribute InteractionSet allOf(DOMString action, optional DOMString device);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;hasAnyOf&#039;&#039;&lt;br /&gt;
::Return true if any of given interaction are in use by the widget.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;interaction&#039;&#039;&lt;br /&gt;
::::list of interactions&lt;br /&gt;
&lt;br /&gt;
AccessibleElement .&#039;&#039;allOf&#039;&#039;&lt;br /&gt;
::Return a list of all interactions with the accessible element as &#039;&#039;InteractionSet&#039;&#039; used to invoke the given action on the given device.&lt;br /&gt;
::Parameters:&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::action name&lt;br /&gt;
:::&#039;&#039;device&#039;&#039;&lt;br /&gt;
::::a device name, examples of supported values are &amp;quot;keyboard&amp;quot;, &amp;quot;mouse&amp;quot;, &amp;quot;touchpad&amp;quot;.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Interaction {&lt;br /&gt;
  stingifier readonly attribute description;&lt;br /&gt;
  readonly attribute device;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of the screen reader announcing all interactions of &amp;lt;code&amp;gt;swipe&amp;lt;/code&amp;gt; action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var actions = accElm.actions;&lt;br /&gt;
actions.forEach(action =&amp;gt; { var set = action.interactions;&lt;br /&gt;
                            say(action.name);&lt;br /&gt;
                            set.values().forEach(item =&amp;gt; say(item.description));&lt;br /&gt;
                          });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent-child relations===&lt;br /&gt;
&lt;br /&gt;
The interface provides a bunch of methods to provide access to parent/child relations between accessible elements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;parent&#039;&#039;&lt;br /&gt;
::Returns the parent accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;firstChild&#039;&#039;&lt;br /&gt;
::Returns the first child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;lastChild&#039;&#039;&lt;br /&gt;
::Returns the last child accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;nextSibling&#039;&#039;&lt;br /&gt;
::Returns the next sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;previousSibling&#039;&#039;&lt;br /&gt;
::Returns the previous sibling accessible element if any.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return &#039;&#039;AccessibleChildren&#039;&#039; collection of all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleChildren {&lt;br /&gt;
  iterable&amp;lt;AccessibleElement&amp;gt;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Consider to move &amp;quot;widget&amp;quot; relation to &amp;quot;widget&amp;quot; IDL attribute (property) under this section.&lt;br /&gt;
&lt;br /&gt;
===Accessible providers===&lt;br /&gt;
&lt;br /&gt;
The accessible element can be created with different kinds of sources. Most of the accessible elements are created for a DOM element to expose its semantics to the assistive technology. In some cases the browser may not have underlying DOM node for the content. In this case the accessible object is created, without having a corresponding DOM element. In some cases a web author may need to change the semantics for existing elements, add new semantics or create a new accessible subtree to make content accessible. In this case the author needs to describe desired semantics in JavaScript. See [[#JSSource|Making the content accessible in JavaScript]] for details.&lt;br /&gt;
&lt;br /&gt;
[[File:WebAccessibilityAPI_SourceProviders.png|The accessible element may be sourced by different kinds of providers]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::Returns a DOM node associated with the accessible element if any. Accessible element does not have a DOM node when it is either not based on it, or when it has been detached from the DOM node. The first case happens for browser-specific implementations or for trees created in JavaScript. The second case happens when the JavaScript holds reference to the object longer than the object life cycle.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;source&#039;&#039;&lt;br /&gt;
::Returns [[#AccessibleSource|AccessibleSource]] if present, refers to an accessible source, used to override accessible properties of the element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Content traversal==&lt;br /&gt;
&lt;br /&gt;
This section describes how to traverse accessible content, for example, if you need to navigate a document by headings or navigate a paragraph by words.&lt;br /&gt;
&lt;br /&gt;
A key concept of the content traversal is accessible position which describes a &amp;quot;location&amp;quot; in the document content. A position can be placed on an accessible element, for example, on a button. It can be placed before or after an accessible element, or inside of the accessible element text, for example, at the end of the first line of a paragraph.&lt;br /&gt;
&lt;br /&gt;
The position can be moved forward or backward inside the document to the content complying with the given criteria. For example, criteria can be described verbally like &amp;quot;move the position forward to next heading&amp;quot; or &amp;quot;move the position one word back&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Accessible Position===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Constructor(AccessibleElement anchor, optional Offset offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMNode container, long offset, optional AccessibleElement root),&lt;br /&gt;
 Constructor(DOMPoint point, optional AccessibleElement root),&lt;br /&gt;
 Constructor(AccessiblePos pos, optional AccessibleElement root)]&lt;br /&gt;
interface AccessiblePos {&lt;br /&gt;
  AccessiblePos? move(AccessibleElement anchor, Offset offset);&lt;br /&gt;
  AccessiblePos? move(DOMNode container, long offset);&lt;br /&gt;
  AccessiblePos? move(DOMPoint);&lt;br /&gt;
  AccessiblePos? move(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  AccessiblePos? search(Where where, Controller);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AccessibleElement root;&lt;br /&gt;
  readonly attribute AccessibleElement? anchor;&lt;br /&gt;
  readonly attribute Offset offset;&lt;br /&gt;
  DOMRangeBound toDOM();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef AccessiblePos A11ePos; // Short and nice name? // Maybe accPos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Construction====&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(AccessibleElement, Offset, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;elm&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::anchor accessible element of the position&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offset&#039;&#039;, optional&lt;br /&gt;
::::an offset relative to the anchor element. If not provided then &#039;&#039;at&#039;&#039; or &#039;&#039;afterbegin&#039;&#039; is used depending on element type.&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef long or OffsetLiterals Offset;&lt;br /&gt;
enum OffsetLiterals {&lt;br /&gt;
  &amp;quot;before&amp;quot;,&lt;br /&gt;
  &amp;quot;afterbegin&amp;quot;,&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;beforeend&amp;quot;,&lt;br /&gt;
  &amp;quot;after&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;before&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;afterbegin&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element beginning&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the accessible position at the accessible element&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;beforeend&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right before the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
OffsetLiterals .&#039;&#039;after&#039;&#039;&lt;br /&gt;
::Used to set the accessible position right after the accessible element ending&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMPoint, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::a point, the accessible position should be set at&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;(DOMNode, long, AccessibleElement)&lt;br /&gt;
::Constructs the accessible position from (DOMNode, offset) pair.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the container node&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset within the container node&lt;br /&gt;
:::&#039;&#039;root&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;, optional&lt;br /&gt;
::::a root of subtree containing the position. If not provided then parent document is used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;Constructor&#039;&#039;&lt;br /&gt;
::Constructs the accessible position equal to given position.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;pos&#039;&#039; of &#039;&#039;AccessiblePos&#039;&#039;&lt;br /&gt;
::::accessible position to copy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), document.accessibleElement);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(button.accessibleElement, &amp;quot;at&amp;quot;);&lt;br /&gt;
var pos3 = new A11ePos(paragraph.accessibleElement, &amp;quot;afterbegin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var pos4 = new A11ePos(pos2);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Move through the content====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(AccessilbeElement, Offset)&lt;br /&gt;
::Move the accessible position to the given anchor and offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;element&#039;&#039; of &#039;&#039;AccessibleElement&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;Offsest&#039;&#039;, optional&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMNode, long)&lt;br /&gt;
::Move the accessible position to the given DOM node at given offset.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;node&#039;&#039; of &#039;&#039;DOMNode&#039;&#039;&lt;br /&gt;
::::the anchor&lt;br /&gt;
:::&#039;&#039;offset&#039;&#039; of &#039;&#039;long&#039;&#039;&lt;br /&gt;
::::offset relative the anchor&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(DOMPoint)&lt;br /&gt;
::Move the accessible position in the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;point&#039;&#039; of &#039;&#039;DOMPoint&#039;&#039;&lt;br /&gt;
::::the point the accessible position should be moved to.&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;move&#039;&#039;(Where, Controller)&lt;br /&gt;
::Move the accessible position to the content. Returns true if succeeded.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;search&#039;&#039;(Where, Controller)&lt;br /&gt;
::Finds the accessible position relative the current one. Returns new instance.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;where&#039;&#039; of &#039;&#039;Where&#039;&#039;&lt;br /&gt;
::::where the search should be performed&lt;br /&gt;
:::&#039;&#039;controller&#039;&#039; of &#039;&#039;Controller&#039;&#039;&lt;br /&gt;
::::function describing a match&lt;br /&gt;
:::Return new instance.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Where { &amp;quot;forward&amp;quot;,&lt;br /&gt;
             &amp;quot;backward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic forward&amp;quot;,&lt;br /&gt;
             &amp;quot;cyclic backward&amp;quot;,&lt;br /&gt;
             &amp;quot;tofirst&amp;quot;,&lt;br /&gt;
             &amp;quot;tolast&amp;quot;,&lt;br /&gt;
             &amp;quot;left&amp;quot;,&lt;br /&gt;
             &amp;quot;right&amp;quot;,&lt;br /&gt;
             &amp;quot;up&amp;quot;,&lt;br /&gt;
             &amp;quot;down&amp;quot;,&lt;br /&gt;
             &amp;quot;above&amp;quot;,&lt;br /&gt;
             &amp;quot;under&amp;quot;,&lt;br /&gt;
             &amp;quot;closest&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Where .&#039;&#039;forward&#039;&#039;&lt;br /&gt;
::Search after the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic forward&#039;&#039;&lt;br /&gt;
::Search forwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;cyclic backward&#039;&#039;&lt;br /&gt;
::Search backwards from the accessible position in cycle.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tofirst&#039;&#039;&lt;br /&gt;
::Search for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;tolast&#039;&#039;&lt;br /&gt;
::Search backwards (from last to first element) for a first match inside the root.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;left&#039;&#039;&lt;br /&gt;
::Search for a match left to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;right&#039;&#039;&lt;br /&gt;
::Search for a match right to the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;up&#039;&#039;&lt;br /&gt;
::Search for a match up from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;down&#039;&#039;&lt;br /&gt;
::Search for a match down from the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;above&#039;&#039;&lt;br /&gt;
::Search for a match above the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;under&#039;&#039;&lt;br /&gt;
::Search for a match under the position.&lt;br /&gt;
&lt;br /&gt;
Where .&#039;&#039;closest&#039;&#039;&lt;br /&gt;
::Search for a geometrically closest match to the position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(elm) { }&lt;br /&gt;
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos2 = new A11ePos(elm, &amp;quot;at&amp;quot;).move(&amp;quot;backward&amp;quot;, controller);&lt;br /&gt;
&lt;br /&gt;
var pos3 = new A11ePos(pos).move(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
or&lt;br /&gt;
var pos2 = pos2.search(&amp;quot;forward&amp;quot;, controller);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Matching function=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback Controller = SearchTerm sequence&amp;lt;SearchTerm&amp;gt; (AccessibleElement);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Controller&lt;br /&gt;
::A matching function used to define an algorithm of how the position is moved through the document.&lt;br /&gt;
::Returns&lt;br /&gt;
:::a search term(s)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum SearchTerm {&lt;br /&gt;
  &amp;quot;char&amp;quot;,&lt;br /&gt;
  &amp;quot;word&amp;quot;,&lt;br /&gt;
  &amp;quot;sentence&amp;quot;,&lt;br /&gt;
  &amp;quot;line&amp;quot;,&lt;br /&gt;
  &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  &amp;quot;change&amp;quot;,&lt;br /&gt;
  &amp;quot;bit&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;at&amp;quot;,&lt;br /&gt;
  &amp;quot;skipsubtree&amp;quot;,&lt;br /&gt;
  &amp;quot;stop&amp;quot;,&lt;br /&gt;
  &amp;quot;next&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;char&#039;&#039;&lt;br /&gt;
::Used to move the position one char long.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;word&#039;&#039;&lt;br /&gt;
::Used to move the position to the next word.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;sentence&#039;&#039;&lt;br /&gt;
::Used to move the position to the next sentence.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;line&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next line or end of previous line.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;paragraph&#039;&#039;&lt;br /&gt;
::Used to move the position to beginning of next/previous paragraph.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;change&#039;&#039;&lt;br /&gt;
::Used to move the position to next change either of text attribute or new accessible.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;bit&#039;&#039;&lt;br /&gt;
::Used to move the position to next/previous navigable position. For example, from accessible start inside of it to right before accessible outside of it or moving from end of this line to start of next line in case of soft line break lines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SearchTerm .&#039;&#039;at&#039;&#039;&lt;br /&gt;
::Used to set the position at the element. Search is stopped.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;stop&#039;&#039;&lt;br /&gt;
::Search is discontinued after other search terms are processed.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;skipsubtree&#039;&#039;&lt;br /&gt;
::Subtree of traversed element is ignored for next step.&lt;br /&gt;
&lt;br /&gt;
SearchTerm .&#039;&#039;next&#039;&#039;&lt;br /&gt;
::Used to continue the search if other search terms weren&#039;t succeed. Default option.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos1 = new A11ePos(document.getElementById(&amp;quot;a&amp;quot;).a11ement);&lt;br /&gt;
var pos2 = pos1.search(&amp;quot;forward&amp;quot;, () = &amp;gt; { return [ &amp;quot;word&amp;quot;, &amp;quot;stop&amp;quot; ];});&lt;br /&gt;
var pos3 = pos1.search(&amp;quot;forward&amp;quot;, () =&amp;gt; { return &amp;quot;word&amp;quot;; });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 and pos3 points after &amp;quot;here&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click &amp;lt;a id=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;, fellow&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
pos2 equals to pos1, pos3 points after &amp;quot;fellow&amp;quot; word in the link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example. Navigate by widgets and structures, and by words in case of text.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function controller(aEl)&lt;br /&gt;
{&lt;br /&gt;
  var role = document.taxonOf(&amp;quot;role&amp;quot;, aEl.role);&lt;br /&gt;
  if (role.is(&amp;quot;widget&amp;quot;)&lt;br /&gt;
    return [ &amp;quot;at&amp;quot;, &amp;quot;skipsubtree&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  if (role.is(&amp;quot;structure&amp;quot;)&lt;br /&gt;
    return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Reenters with next accessible if it cannot move to the next word within this accessible.&lt;br /&gt;
  if (role.is(&amp;quot;textcontainer&amp;quot;))&lt;br /&gt;
    return &amp;quot;word&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  return &amp;quot;next&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pos.move(&amp;quot;next&amp;quot;, finder);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other methods====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessiblePos .&#039;&#039;root&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position movement is restricted to.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;anchor&#039;&#039;&lt;br /&gt;
::Returns the accessible element the position is at or contained by.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;offset&#039;&#039;&lt;br /&gt;
::Return an offset of the accessible position, either numeric or text.&lt;br /&gt;
&lt;br /&gt;
AccessiblePos .&#039;&#039;toDOM&#039;&#039;&lt;br /&gt;
::Returns DOMRangeBound object which is a pair of DOM node and content offset relative it.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary DOMRangeBound {&lt;br /&gt;
  DOMNode node;&lt;br /&gt;
  long offset;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions/concerns===&lt;br /&gt;
&lt;br /&gt;
* Do we need *is* method right on AccessibleElement or should we have Role interface having that method or should AccessibleElement return role taxa as a role.&lt;br /&gt;
* Do we need to have &amp;quot;inContextOf&amp;quot; on AccessibleElement to check what the accessilbe belongs to. Note, native implementation doing some cache may be faster than tree traversal. If we need it then it&#039;s worth to consider *is* method too.&lt;br /&gt;
* Do we need isAnyOf() method additionally?&lt;br /&gt;
* Yura: we should have async API for search.&lt;br /&gt;
* Do we need to compare() method to compare two positions&lt;br /&gt;
&lt;br /&gt;
===Virtual cursor===&lt;br /&gt;
&lt;br /&gt;
Virtual cursor is accessible position attached to the accessible document. It&#039;s unique per document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  AccesiblePos cursor;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whenever the virtual cursor position is changed then &#039;&#039;cursor_moved&#039;&#039; event is fired.&lt;br /&gt;
&lt;br /&gt;
Questions/concerns:&lt;br /&gt;
* Ensure that the virtual cursor is survivable. If it ends up in the hidden sub-tree for example. If subtee gets destroyed then cursor should be moved. If AccessiblePos doesn&#039;t have matching function then it&#039;s unclear where it should be moved.&lt;br /&gt;
* Also take into account walking to/from parent/child frames&lt;br /&gt;
* Should it be outlined as moved?&lt;br /&gt;
&lt;br /&gt;
==Text==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessiblePos {&lt;br /&gt;
  DOMString textInBetween(AccessiblePos pos);&lt;br /&gt;
  readonly attribute AttributeSet textAttributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textInBetween&#039;&#039;&lt;br /&gt;
::Returns the text enclosed between this and given accessible positions.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example how to get first line of the first encountered paragraph:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var startPos = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
var endPos = startPos &amp;amp;&amp;amp; startPos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; [ &amp;quot;line&amp;quot;, &amp;quot;stop&amp;quot; ]);&lt;br /&gt;
var text = startPos.textInBeetween(startPos, endPos);&lt;br /&gt;
&lt;br /&gt;
say(text);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ Promise variant if we had async API].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function getText() {&lt;br /&gt;
  var p = new A11ePos().move(&amp;quot;first&amp;quot;, a =&amp;gt; a.role == &amp;quot;paragraph&amp;quot;);&lt;br /&gt;
  var startPos;&lt;br /&gt;
  return p.then(function(pos) { &lt;br /&gt;
    startPos = pos; &lt;br /&gt;
    return pos.search(&amp;quot;forward&amp;quot;, a =&amp;gt; &amp;quot;line&amp;quot;); }).&lt;br /&gt;
  then(function(endPos) {&lt;br /&gt;
    return startPos.textInBetween(endPos);&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
getText().then(function(text) { /* Say text */ })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text attributes===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;textAttributes&#039;&#039;&lt;br /&gt;
::Returns a [[#AttributeSet|AttributeSet]] of all text attributes presented at this accessible position.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of text attributes [to complete]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
color&lt;br /&gt;
::Text color&lt;br /&gt;
&lt;br /&gt;
background-color&lt;br /&gt;
::Background color of text&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;p id=&amp;quot;p&amp;quot;&amp;gt;hello &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var pos = new A11ePos(document.getElementById(&amp;quot;p&amp;quot;).a11ement, 7);&lt;br /&gt;
p.textAttributes.get(&amp;quot;font-weight&amp;quot;) == 700; // true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Caret and selection==&lt;br /&gt;
&lt;br /&gt;
Document accessible provides bunch of methods to operate on text selection and caret.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  attribute AccessiblePos caret;&lt;br /&gt;
  attribute AccessiblePos? selectionStart;&lt;br /&gt;
  attribute AccessiblePos? selectionEnd;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;caret&#039;&#039;&lt;br /&gt;
::Returns accessible position for the caret.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionStart&#039;&#039;&lt;br /&gt;
::Get/set selection start.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;selectionEnd&#039;&#039;&lt;br /&gt;
::Get/set selection end.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var pos = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
document.a11ement.selectionStart = pos;&lt;br /&gt;
var pos2 = new A11ePos(pos.anchor.nextSibling);&lt;br /&gt;
document.a11ement.selectionEnd = pos;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Connection with DOM selection.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var sel = window.getSelection();&lt;br /&gt;
var pos1 = new A11ePos(sel.anchorNode, sel.anchorOffset);&lt;br /&gt;
var pos2 = new A11ePos(sel.focusNode, sel.focusOffset);&lt;br /&gt;
&lt;br /&gt;
var p1 = pos1.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setStart(p1.node, p1.offset);&lt;br /&gt;
var p2 = pos2.toDOM();&lt;br /&gt;
sel.getRangeAt(0).setEnd(p2.node, p2.offset);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Geometry==&lt;br /&gt;
&lt;br /&gt;
The section contains bunch of methods and approaches to deal with web page geometry.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void outline(AccessiblePos pos1, optional AccessiblePos pos2);&lt;br /&gt;
  void clearOutlines();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;outline&#039;&#039;&lt;br /&gt;
::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;clearOutlines&#039;&#039;&lt;br /&gt;
::Removes all drawn outlines.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Geometrical navigation===&lt;br /&gt;
&lt;br /&gt;
AT can scan the web page by moving the position geometrically up/down/left/right.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var scanner&lt;br /&gt;
{&lt;br /&gt;
  start: function() {&lt;br /&gt;
    if (this.stopped)&lt;br /&gt;
      return;&lt;br /&gt;
&lt;br /&gt;
    var nextpos = this.pos.move(&amp;quot;right&amp;quot;, this.controller);&lt;br /&gt;
    if (!nextpos)&lt;br /&gt;
      nextpos = this.pos.move(&amp;quot;down&amp;quot;, this.controller);&lt;br /&gt;
&lt;br /&gt;
    if (nextpos) {&lt;br /&gt;
      document.outline(nextpos);&lt;br /&gt;
      window.setTimeout(this.start.bing(this), 1000);&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  stop: function() {&lt;br /&gt;
    this.stopped = true;&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  controller: function(aEl) {&lt;br /&gt;
    var role = document.a11ement.taxonOf(&amp;quot;role&amp;quot;, aElm.role);&lt;br /&gt;
    if (role.is(&amp;quot;widget&amp;quot;))&lt;br /&gt;
      return &amp;quot;at&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;next&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  pos: new A11ePos(new DOMPoint(0, 0)),&lt;br /&gt;
  stopped: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hit testing===&lt;br /&gt;
&lt;br /&gt;
The author can do accessible position to match the accessible element of given criteria at given position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function onmove(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  // Announce name of the accessible element pointed by mouse.&lt;br /&gt;
  var atcursor = new A11ePos(new DOMPoint(event.x, event.y));&lt;br /&gt;
  say(atcursor.anchor.name);&lt;br /&gt;
&lt;br /&gt;
  // Locate a nearest control.&lt;br /&gt;
  var atwidget = atcursor.search(&amp;quot;closest&amp;quot;, a =&amp;gt; document.taxonOf(&amp;quot;role&amp;quot;, a.role).is(&amp;quot;widget&amp;quot;));&lt;br /&gt;
  if (atwidget)&lt;br /&gt;
    say(atwidget.name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onmove=&amp;quot;onmove(event);&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions/concerns&lt;br /&gt;
*Outline: it&#039;s tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background.&lt;br /&gt;
*Do we need a way to return coordinates of accessible position&#039;s edge points?&lt;br /&gt;
*Do we need a method to calculate distance between two positions?&lt;br /&gt;
*Do we need a method to calculate boundaries (aka containing rect)?&lt;br /&gt;
*Do we need a method to check whether the given point is contained by a range?&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
The accessible element may fire various number of events. You can add event listener on document accessible to handle all events from accessible elements belonging to the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback AccessibleEventListener (AccessibleEvent event);&lt;br /&gt;
&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void on(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
  void off(DOMString eventType, AccessibleEventListener listener);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;on&#039;&#039;&lt;br /&gt;
::Adds event listener of the given event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleDocument .&#039;&#039;off&#039;&#039;&lt;br /&gt;
::Removes event listener of the given event type.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All event objects implement &amp;lt;code&amp;gt;AccessibleEvent&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleEvent {&lt;br /&gt;
  readonly attribute DOMString type;&lt;br /&gt;
  readonly attribute AccessibleElement target;&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleEvent .&#039;&#039;type&#039;&#039;&lt;br /&gt;
::Event type.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;target&#039;&#039;&lt;br /&gt;
::Event type accessible element target.&lt;br /&gt;
&lt;br /&gt;
AccessibleEvent .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Extra attributes used to describe the event. Used for certain event types.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Live regions processing.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function handleLiveRegion(aEvent)&lt;br /&gt;
{&lt;br /&gt;
  var attrs =&lt;br /&gt;
    { live: &amp;quot;assertive&amp;quot;, relevant: &amp;quot;change:name&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
  if (aEvent.attributes.hasAllOf(attrs)) {&lt;br /&gt;
    say(aEvent.target.name);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Event types===&lt;br /&gt;
&lt;br /&gt;
[section needs to be completed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;focus&amp;quot;&lt;br /&gt;
::Fired when accessible element is focused.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;caretmove&amp;quot;&lt;br /&gt;
::Fired when caret is moved within the document.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;change:name&amp;quot;&lt;br /&gt;
::Fired when name property is changed.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Patterns&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Patterns==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controls may expose own patterns to expose their semantics if it cannot be expressed by accessible element properties.&lt;br /&gt;
&lt;br /&gt;
===Value controls===&lt;br /&gt;
&lt;br /&gt;
Control elements having numeric value like slider, progressbar, [https://html.spec.whatwg.org/multipage/forms.html#the-meter-element meter] or numberbox implement &amp;lt;code&amp;gt;AccessibleValue&amp;lt;/code&amp;gt; inteface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleValue {&lt;br /&gt;
  readonly attribute long max;&lt;br /&gt;
  readonly attribute long min;&lt;br /&gt;
  readonly attribute long low;&lt;br /&gt;
  readonly attribute long high;&lt;br /&gt;
  readonly attribute long optimum;&lt;br /&gt;
  readonly attribute long step;&lt;br /&gt;
  readonly attribute long value;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Group info===&lt;br /&gt;
&lt;br /&gt;
Item elements provides information about their group and their position in the group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleGroupInfo {&lt;br /&gt;
  readonly attribute long count;&lt;br /&gt;
  readonly attribute long index;&lt;br /&gt;
  readonly attribute long level;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tables===&lt;br /&gt;
&lt;br /&gt;
A cell of tables and grids provide the interface for 2 dimensional navigation. Cell headers can be obtained by &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface AccessibleTableCell {&lt;br /&gt;
  readonly attribute unsigned long rowIndex;&lt;br /&gt;
  readonly attribute unsigned long colIndex;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned long rowSpan;&lt;br /&gt;
  readonly attribute unsigned long colSpan;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowIndex&#039;&#039;&lt;br /&gt;
::Return row index of the cell.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colIndex&#039;&#039;&lt;br /&gt;
::Return column index of the cell.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTableCell .&#039;&#039;rowSpan&#039;&#039;&lt;br /&gt;
::Return number of rows that the cell is spanned to.&lt;br /&gt;
&lt;br /&gt;
AccessibleTableCell .&#039;&#039;colSpan&#039;&#039;&lt;br /&gt;
::Return number of columns that the cell is spanned to.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;JSSource&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make the content accessible==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can tweak the accessible tree right in JS. You can do both:&lt;br /&gt;
* extend the native semantics of the DOM element by overriding its accessible properties,&lt;br /&gt;
* create whole accessible trees for inaccessible content, for example, for graphics, charts in a canvas.&lt;br /&gt;
&lt;br /&gt;
===Direct change of accessible properties===&lt;br /&gt;
&lt;br /&gt;
Accessible element properties can be altered right on the accessible element. Changing accessible property will result in accessible events if needed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var div = document.getElementById(&amp;quot;button&amp;quot;).a11ement;&lt;br /&gt;
div.name = &amp;quot;click me&amp;quot;;&lt;br /&gt;
div.description = &amp;quot;test accessibility&amp;quot;;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accessible name and description are changed for the accessible button, &amp;quot;name changed&amp;quot; and &amp;quot;description changed&amp;quot; events are fired. Note, it changes neither visual appearance of the button nor DOM button element properties. If affects on accessible element of the button only.&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
parital interface StateSet {&lt;br /&gt;
  void set(DOMString ... states);&lt;br /&gt;
  void unset(DOMString ... states);&lt;br /&gt;
  void toggle(DOMString state);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
StateSet .&#039;&#039;set&#039;&#039;&lt;br /&gt;
::Set given states on the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;unset&#039;&#039;&lt;br /&gt;
::Unset given states from the accessible element.&lt;br /&gt;
&lt;br /&gt;
StateSet .&#039;&#039;toggle&#039;&#039;&lt;br /&gt;
::Toggle the state on the accessible element.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;checkbox&amp;quot; onclick=&amp;quot;disableEnable();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div role=&amp;quot;listbox&amp;quot; id=&amp;quot;listbox&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function disableEnable()&lt;br /&gt;
{&lt;br /&gt;
  var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
  listbox.states.toggle(&amp;quot;disabled&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
You can add/change/delete attributes on the accessible element. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listbox = document.getElementById(&amp;quot;listbox&amp;quot;).a11ement;&lt;br /&gt;
listbox.attributes.set(&amp;quot;autocomplete&amp;quot;, &amp;quot;list&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface RelationMap {&lt;br /&gt;
  void add(DOMString relation, AccessibleElement element);&lt;br /&gt;
  void remove(DOMString relation, AccessibleElement element);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RelationMap .&#039;&#039;add&#039;&#039;&lt;br /&gt;
::Puts the accessible element into relations.&lt;br /&gt;
&lt;br /&gt;
RelationMap .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Breaks the given relations between these accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var label = document.getElementById(&amp;quot;label&amp;quot;);&lt;br /&gt;
var control = document.getElementById(&amp;quot;control&amp;quot;).a11ement;&lt;br /&gt;
control.relations.add(&amp;quot;labelledby&amp;quot;, label.a11yment);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to do actions/interactions and patterns]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AccessibleSource&amp;quot;&amp;gt;&lt;br /&gt;
===Extend the semantic via accessible source===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can extend native semantic of a DOM element by connecting it to an accessible source, the object describing accessible element. If the DOM node is not accessible then setting the accessible source on it makes it accessible. Otherwise the given source lands on top of the existing accessible object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface Node {&lt;br /&gt;
  attribute AccessibleSource? accessibleSource;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the DOM node is accessible then you can provide accessible source by setting it up right in &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  attribute AccessibleSource? source;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source object used to describe the accessible element implements &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; interface which basically portrays properties of &amp;lt;code&amp;gt;AccessibleElement&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
callback interface AccessibleSource {&lt;br /&gt;
  readonly attribute DOMString role;&lt;br /&gt;
  readonly attribute sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
  readonly attribute DOMString value;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object attributes;&lt;br /&gt;
  readonly attribute object relations;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute DOMString text;&lt;br /&gt;
  object textAttributesAt(offset);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute object actions;&lt;br /&gt;
  void activate(DOMString action);&lt;br /&gt;
&lt;br /&gt;
  AccessibleElement? element;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Basics====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;role&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;states&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;description&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;value&#039;&#039;&lt;br /&gt;
::These properties corresponds to properties of &#039;&#039;AccessibleElement&#039;&#039; interface.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Override accessible name of the button.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the author needs to change accessible name of the HTML button&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;button id=&amp;quot;btn&amp;quot;&amp;gt;press me&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then he can do this either with ARIA&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).setAttribute(&amp;quot;aria-label&amp;quot;, &amp;quot;new name&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or set it directly on the accessible element&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).a11ement.name = &amp;quot;new name&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by setting its accessible source&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = { name: &amp;quot;new name&amp;quot;; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are two equivalent approaches that can be used same time and mixed with each other the way that better fits the author&#039;s intent. It&#039;s important to keep in mind though that the accessible source has a priority over ARIA attributes. Setting up the accessible source doesn&#039;t operate on DOM and thus it&#039;s supposed to be more performant as extra layer is excluded between the author and accessibility engine. Another benefit of setting the accessible source is improved code readability since the author is able to point multiple properties at once in declarative way. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.getElementById(&amp;quot;btn&amp;quot;).accessibleSource = {&lt;br /&gt;
  name: &amp;quot;new name&amp;quot;,&lt;br /&gt;
  description: &amp;quot;new description&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;disabled&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes and relations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::A map of attribute names and their values applied to the accessible element&lt;br /&gt;
AccessibleSource .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::A map of relation types and relations for this accessible element. The bunch of types may be used to point out related elements. You can use either &#039;&#039;Node&#039;&#039;, &#039;&#039;AccessibleElement&#039;&#039; or &#039;&#039;AccessibleSource&#039;&#039; objects. In latter case the object has to be in the accessible tree, in other words, it has to have associated accessible element when relation is poked by AT.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #2. Adding semantics.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accessible source can be also used when the author wants to add semantics to semantically neutral element. For example, the author can turn an ordinal HTML div element into listbox control:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;label id=&amp;quot;label&amp;quot;&amp;gt;Names:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    &amp;quot;labelledby&amp;quot;: [ document.getElementById(&amp;quot;label&amp;quot;) ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.accessibleSource = listboxSource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth to notice that accessible source approach like ARIA doesn&#039;t require the author to provide comprehensive description, i.e. correlating properties may be skipped. For example, presented &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation makes unnecessary to provide accessible name. The browser should handle this on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Lazy computations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The previous example may look bulkier than its ARIA equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxNode = document.getElementById(&amp;quot;list&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
listboxNode.setAttribute(&amp;quot;aria-labelledby&amp;quot;, &amp;quot;label&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but its benefit is it allows accessible properties lazy computation. An accessible property whose value isn&#039;t changed during whole life cycle of its accessible element or which doesn&#039;t require an accessible event on its change is good candidate for lazy computation. For example the previous example may be modified this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  relations: {&lt;br /&gt;
    get labelledby() {&lt;br /&gt;
      return document.querySelectorAll(&amp;quot;*[listboxlabel]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the &amp;lt;code&amp;gt;labelledby&amp;lt;/code&amp;gt; relation getter is more powerful than its ARIA version and all computations are running iff somebody inquired the relation.&lt;br /&gt;
&lt;br /&gt;
====Text====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleTextSource .&#039;&#039;text&#039;&#039;&lt;br /&gt;
::Return the text.&lt;br /&gt;
&lt;br /&gt;
AccessibleTextSource .&#039;&#039;textAttributesAt&#039;&#039;&lt;br /&gt;
::Returns object of { name: value } pairs representing text attributes at given offset within the accessible element text.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Example #4. Text content.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While text should be normally in the content, there are cases when the author has to provide it for non-text content. For example, this technique can be used to turn HTML image into text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var elm = document.getElementById(&amp;quot;container&amp;quot;);&lt;br /&gt;
elm.innerHTML = &amp;quot;I &amp;quot; + &amp;lt;img src=&amp;quot;love.png&amp;quot;&amp;gt; + &amp;quot;you&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var psource = {&lt;br /&gt;
  role: &amp;quot;paragraph&amp;quot;,&lt;br /&gt;
  text: &amp;quot;I love you&amp;quot;,&lt;br /&gt;
  textAttributesAt: function(aOffset) {&lt;br /&gt;
    if (aOffset &amp;gt;= 5 &amp;amp;&amp;amp; aOffset &amp;lt;= 7) {&lt;br /&gt;
      return { color: &amp;quot;red&amp;quot; }; // &amp;quot;love&amp;quot; is red&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
elm.accessibleSource = psource;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;actions&#039;&#039;&lt;br /&gt;
::Return all supported actions on the accessible element.&lt;br /&gt;
&lt;br /&gt;
AccessibleSource .&#039;&#039;activate&#039;&#039;&lt;br /&gt;
::Invoke the given action.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::&#039;&#039;action&#039;&#039;&lt;br /&gt;
::::the action name to invoke&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #5. Describe actions and interactions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function listitem(aName)&lt;br /&gt;
{&lt;br /&gt;
  return {&lt;br /&gt;
    role: &amp;quot;treeitem&amp;quot;,&lt;br /&gt;
    name: aName,&lt;br /&gt;
    actions: {&lt;br /&gt;
      select: {&lt;br /&gt;
        interactions: [ { mouse: &amp;quot;click&amp;quot; } ]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case if interactions cannot be provided then the accessible source have to implement &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt; method to invoke actions.&lt;br /&gt;
&lt;br /&gt;
====Proto====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;proto&#039;&#039;&lt;br /&gt;
::Point to accessible element implementation as it was before &#039;source&#039; set. Set by the browser when the accessible source is attached to the accessible element. &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Change the accessible tree===&lt;br /&gt;
&lt;br /&gt;
The web developer can alter existing accessible tree including subtree creations and deletions. This can be done either by &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object assigned to the accessible element or by direct manipulations on the accessible tree.&lt;br /&gt;
&lt;br /&gt;
====Direct tree alteration====&lt;br /&gt;
&lt;br /&gt;
Accessible source object can be used to create new accessible element and insert it into the tree. If DOM node is used as a source then associated subtrees of accessible elements within the DOM node are reparanted, i.e. they are removed from children of its current accessible parent and added as children of new parent. Accessible element can be removed from children.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleChildren {&lt;br /&gt;
  void append(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertBefore(AccessibleElement before, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void insertAfter(AccessibleElement after, AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void replace(AccessibleSource or DOMNode ... children);&lt;br /&gt;
  void remove(AccessibleElement ... children);&lt;br /&gt;
  void clear();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Children .&#039;&#039;append&#039;&#039;&lt;br /&gt;
::Appends accessible elements provided by sources as children to the accessible element.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertBefore&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources before the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;insertAfter&#039;&#039;&lt;br /&gt;
::Inserts accessible elements provided by sources after the given child.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;replace&#039;&#039;&lt;br /&gt;
::Replaces existing children accessible elements within elements provided by sources.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;remove&#039;&#039;&lt;br /&gt;
::Removes accessible elements from the accessible tree.&lt;br /&gt;
&lt;br /&gt;
Children .&#039;&#039;clear&#039;&#039;&lt;br /&gt;
::Removes all child accessible elements.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input id=&amp;quot;input&amp;quot; role=&amp;quot;combobox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;list&amp;quot; role=&amp;quot;listbox&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div role=&amp;quot;listitem&amp;quot;&amp;gt;choice1&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var input = document.getElementById(&amp;quot;input&amp;quot;).a11ement;&lt;br /&gt;
input.children.replace(document.getElementById(&amp;quot;list&amp;quot;));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Build up the tree via accessible source====&lt;br /&gt;
&lt;br /&gt;
You can provide child accessible elements for the given accessible element by assigning &amp;lt;code&amp;gt;AccessibleSource&amp;lt;/code&amp;gt; object to it. This approach allows to create whole portions of the accessible tree for the content having no underlying DOM nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleSource {&lt;br /&gt;
  sequence&amp;lt;AccessibleSource or DOMNode&amp;gt; children;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleSource .&#039;&#039;children&#039;&#039;&lt;br /&gt;
::Return collection of accessible children. If AccessibleSource is provided then it&#039;s used to create a new accessible element and insert it as a child. If accessible DOMNode is provided then its accessible element is used, if inaccessible DOMNode is provided then its accessible children if any are used.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example. Add list with items into the tree.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var tree = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;colors&amp;quot;,&lt;br /&gt;
  children: [&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;red&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
      states: &amp;quot;focusable&amp;quot;,&lt;br /&gt;
      name: &amp;quot;green&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
};&lt;br /&gt;
divNode.accessibleSource = tree;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canvas hit regions====&lt;br /&gt;
&lt;br /&gt;
Canvas [https://html.spec.whatwg.org/multipage/scripting.html#hit-regions hit region options] are extended by &#039;&#039;a11ement&#039;&#039; which is used to connect accessible element with hit region. Whenever hit region is activated then &#039;&#039;activate&#039;&#039; method of connected &#039;&#039;AccessibleSource&#039;&#039; object is called with no argument provided.&lt;br /&gt;
&lt;br /&gt;
Say you have a canvas with drawn button. In order to make it accessible you can create accessible button right in JS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;button&amp;quot;,&lt;br /&gt;
  name: &amp;quot;test&amp;quot;,&lt;br /&gt;
  actions: {&lt;br /&gt;
    click: {&lt;br /&gt;
      interactions: {&lt;br /&gt;
        mouse: &amp;quot;click&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  onactivated: function(aEvent) {&lt;br /&gt;
    if (aEvent.region == &amp;quot;button&amp;quot;)&lt;br /&gt;
      this.proto.set(&amp;quot;focused&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      this.proto.states.unset(&amp;quot;focused&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  proto: null&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
canvasNode.addHitRegion({ id: &amp;quot;button&amp;quot;, a11ement: source });&lt;br /&gt;
canvasNode.addEventListener(&amp;quot;click&amp;quot;, source.onactivated.bind(source));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Feedback notifications===&lt;br /&gt;
&lt;br /&gt;
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleElement {&lt;br /&gt;
  void notifyOf(DOMString eventType, optional Object attrs);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleElement .&#039;&#039;notifyOf&#039;&#039;&lt;br /&gt;
::Called when source has been changed to notify the host accessible element about property change. The browser is responsible to fire proper accessible events and update its internal representation.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::prop&lt;br /&gt;
::::Name of the property like &#039;&#039;role&#039;&#039; or &#039;&#039;state&#039;&#039;&lt;br /&gt;
:::value&lt;br /&gt;
::::Value describing the event.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the above listbox gets disabled then you have to reflect that in its state:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var listboxSource = {&lt;br /&gt;
  role: &amp;quot;listbox&amp;quot;,&lt;br /&gt;
  name: &amp;quot;breed list&amp;quot;,&lt;br /&gt;
  states: &amp;quot;disabled&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  get element() { return this.elm; }&lt;br /&gt;
  set element(aElm) {&lt;br /&gt;
    this.elm = aElm;&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:name&amp;quot;);&lt;br /&gt;
    this.elm.notifyOf(&amp;quot;change:states&amp;quot;, { added: &amp;quot;disabled&amp;quot; });&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implied semantics===&lt;br /&gt;
&lt;br /&gt;
The author has to be less verbose as possible. If a role usually implies number of sets or attributes then they are supposed to set so the authur doesn&#039;t need to list them. For example if &amp;lt;code&amp;gt;listitem&amp;lt;/code&amp;gt; is selectable then you don&#039;t have to point &amp;lt;code&amp;gt;selectable&amp;lt;/code&amp;gt; state on it, in other words, these code snippets are equivalent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var source = {&lt;br /&gt;
  role: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
  states: [ &amp;quot;selectable&amp;quot; ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The implied semantics is described by [[#SemanticsProviders|semantics provides]].&lt;br /&gt;
&lt;br /&gt;
===Conflicts===&lt;br /&gt;
&lt;br /&gt;
[to be done conflicts between native semantics, ARIA and this API]&lt;br /&gt;
&lt;br /&gt;
===Sniffing===&lt;br /&gt;
&lt;br /&gt;
In order to make optimization the content provider has to know whether accessibility consumer is active. The provider can add a callback for &amp;lt;code&amp;gt;deploy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conceal&amp;lt;/code&amp;gt; event types which will be triggered when consumer appears/gets inactive. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function deployA11y() {&lt;br /&gt;
  // build accessible tree or update existing one&lt;br /&gt;
  // keep the tree updated&lt;br /&gt;
}&lt;br /&gt;
function stopA11y() {&lt;br /&gt;
  // stop keeping the accessible tree updated&lt;br /&gt;
}&lt;br /&gt;
document.a11ement.on(&amp;quot;deploy&amp;quot;, deployA11y);&lt;br /&gt;
document.a11ement.on(&amp;quot;conceal&amp;quot;, stopA11y);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;SemanticsProviders&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Semantics providers==&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The author of the content which is not a standard HTML has to provide content semantics to make the content accessible. In other words, he has to describe a semantic vocabulary that will be used to give the content specific meaning. For example, if you are ebook publisher then you will need a bunch of new roles like &#039;bibliography&#039; or &#039;appendix&#039;. If you do operate with complex widgets then likely you will need to describe its states, attributes or relations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  void import(DOMString name, Object taxonomy);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;import&#039;&#039;&lt;br /&gt;
::Import the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name of DOMString&lt;br /&gt;
::::taxonomy name like &#039;&#039;role&#039;&#039; or &#039;&#039;states&#039;&#039;&lt;br /&gt;
:::taxonomy of Object&lt;br /&gt;
::::a collection of taxa and their properties.&lt;br /&gt;
::Throws&lt;br /&gt;
:::if there&#039;s names conflict or there are invalid relations between taxonomies then an exception should be thrown [todo].&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Depending on [[#TaxonomyTypes|taxonomy type]], a taxa may be described by specific fields and be connected with other taxonomies. For example, DPUB semantics may be described this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;,&lt;br /&gt;
{&lt;br /&gt;
  appendix: {&lt;br /&gt;
    parents: &amp;quot;section&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;appendix&amp;quot;,&lt;br /&gt;
    description: &amp;quot;appendix&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  bibliography: {&lt;br /&gt;
    parents: &amp;quot;list&amp;quot;,&lt;br /&gt;
    landmark: &amp;quot;bibliography&amp;quot;,&lt;br /&gt;
    owns: &amp;quot;biblioentry&amp;quot;,&lt;br /&gt;
    description: &amp;quot;bibliography&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  biblioentry: {&lt;br /&gt;
    parents: &amp;quot;listitem&amp;quot;,&lt;br /&gt;
    description: &amp;quot;reference&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach is alternative to [https://w3c.github.io/aria/aria/dpub.html DPUB ARIA extensions]. Any web app operating with DPUB content can import JS file describing the taxonomies and the browser can expose the content properly to the assistive technology. No special support on the browser side is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short reasons to provide taxonomy are:&lt;br /&gt;
* The browser automatically maps the content to desktop accessibility APIs;&lt;br /&gt;
* The web accessibility technology knows how to expose the content;&lt;br /&gt;
* Adds implied accessibility support for the content;&lt;br /&gt;
* Automatic content validation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Taxonomy&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomies===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get hierarchical relations between roles, states, actions or anything else that has a taxonomy. For example, if the web author introduces a role &#039;checklistitem&#039; which is compound from two roles &#039;checkbox&#039; and &#039;listitem&#039;, i.e it inherits properties of both of them then the web author should integrate the new role into existing role hierarchy. Taxonomies are scoped by &amp;lt;code&amp;gt;AccessibleDocument&amp;lt;/code&amp;gt; which provides bunch of methods to get them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
partial interface AccessibleDocument {&lt;br /&gt;
  Taxon? taxonOf(in DOMString taxonomy, in DOMString name);&lt;br /&gt;
  Taxonomy? taxonomyOf(DOMString name);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonOf&#039;&#039;&lt;br /&gt;
::Returns a taxon for the given taxon name of requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxonomy&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
:::name&lt;br /&gt;
::::name of requested taxa like &#039;button&#039; in case of &#039;role&#039; taxonomy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AccessibleDocument .&#039;&#039;taxonomyOf&#039;&#039;&lt;br /&gt;
::Return an object describing requested taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a taxonomy name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxon {&lt;br /&gt;
  stringifier readonly attribute DOMString name;&lt;br /&gt;
  readonly attribute DOMString description;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; parentTaxa;&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; childTaxa;&lt;br /&gt;
&lt;br /&gt;
  bool is(DOMString or Taxon base);&lt;br /&gt;
&lt;br /&gt;
  readonly attribute AttributeMap attributes;&lt;br /&gt;
  readonly attribute RelationMap relations;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;name&#039;&#039;&lt;br /&gt;
::Return name of the taxa&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Return localized description of the taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;parentTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa the taxon is inherited from.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;childTaxa&#039;&#039;&lt;br /&gt;
::Return list of taxa that is inherited from this taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;is&#039;&#039;&lt;br /&gt;
::Return true if given taxon name is in base of the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxon .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::Return a map between attribute names and attribute values specific for the taxon.&lt;br /&gt;
&lt;br /&gt;
Taxon .&#039;&#039;relations&#039;&#039;&lt;br /&gt;
::Return a map between relation types and related taxa specific for the taxon.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #1. Handle new role as it was known.&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxa = {&lt;br /&gt;
  checklistitem: {&lt;br /&gt;
    parents: [ &amp;quot;checkbox&amp;quot;, &amp;quot;menuitem&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
document.accessibleElement.import(&amp;quot;role&amp;quot;, taxa);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleElement.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;checklistitem&amp;quot;);&lt;br /&gt;
if (taxon.is(&amp;quot;menuitem&amp;quot;)) {&lt;br /&gt;
  // process menuitem selection&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #2. Checking whether role is a navigational landmark.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;main&amp;quot;);&lt;br /&gt;
var isLandmark = taxon.attributes.has(&amp;quot;landmark&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example #3. Getting states specific to the role.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var taxon = document.accessibleDocument.taxonOf(&amp;quot;role&amp;quot;, &amp;quot;listbox&amp;quot;);&lt;br /&gt;
print(listboxRole.relations.get(&amp;quot;states&amp;quot;))); // prints &amp;quot;focusable&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Managing the taxonomies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface Taxonomy {&lt;br /&gt;
  Taxon? taxonOf(DOMString name);&lt;br /&gt;
  readonly attribute sequence&amp;lt;Taxon&amp;gt; rootTaxa;&lt;br /&gt;
&lt;br /&gt;
  void addTaxon(DOMString name, sequence&amp;lt;Taxon or DOMString&amp;gt; baseTaxa);&lt;br /&gt;
  void removeTaxon(Taxon taxon);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;getTaxon&#039;&#039;&lt;br /&gt;
::Return a taxon object for the given name.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::taxon name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;rootTaxa&#039;&#039;&lt;br /&gt;
::Return list of base taxa&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;addTaxon&#039;&#039;&lt;br /&gt;
::Adds new taxon into the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::name&lt;br /&gt;
::::a new taxon name&lt;br /&gt;
:::baseTaxa&lt;br /&gt;
::::a list of taxa the taxon is inherited from&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Taxonomy .&#039;&#039;removeTaxon&#039;&#039;&lt;br /&gt;
::Remove the given taxon and all taxa inherited from it from the taxonomy.&lt;br /&gt;
::Parameters&lt;br /&gt;
:::taxon&lt;br /&gt;
::::taxon object&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;TaxonomyTypes&amp;quot;&amp;gt;&lt;br /&gt;
===Taxonomy types===&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Roles====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary RoleTaxa {&lt;br /&gt;
  DOMString landmark;&lt;br /&gt;
  DOMString description;&lt;br /&gt;
&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; parents;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; owns;&lt;br /&gt;
  DOMString or sequence&amp;lt;DOMString&amp;gt; states;&lt;br /&gt;
  Object attributes;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
RoleTaxa .&#039;&#039;landmark&#039;&#039;&lt;br /&gt;
::Navigation landmark name if applicable.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;description&#039;&#039;&lt;br /&gt;
::Localized role description.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;parents&#039;&#039;&lt;br /&gt;
::List of roles the role is inherited from.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;owns&#039;&#039;&lt;br /&gt;
::List of roles allowed in children of the role. Used for validation.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;states&#039;&#039;&lt;br /&gt;
::List of states allowed on the role.&lt;br /&gt;
&lt;br /&gt;
RoleTaxa .&#039;&#039;attributes&#039;&#039;&lt;br /&gt;
::List of attributes maintained by the role.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====States====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dictionary StateTaxa {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML and beyond=&lt;br /&gt;
&lt;br /&gt;
This doc introduces common patterns to express the semantics of markup languages to accessibility. Markup specifics is not a target for this doc in general. Each markup specification has to take care to describe their accessibility stuff in terms of this API.&lt;br /&gt;
&lt;br /&gt;
=Extensibility=&lt;br /&gt;
&lt;br /&gt;
The web application might need to extend default taxonomies to express the new semantics. For example, the web service publishing music sheets can introduce new characteristics like role, states, etc to describe music sheet content. However the web application should take care to explain new characteristic by extending default taxonomies, i.e. by describing the connection between old and new characteristics. That will resolve any backward compatibility issue, so if the consumer doesn&#039;t know about new roles then he can still figure out a closest match it&#039;s aware about. For example, if the web app author introduces &amp;quot;x-redbutton&#039; and provides a role taxonomy for it saying this is an extension of &#039;button&#039; role, then the consumer unfamiliar with &#039;x-redbutton&#039; role will treat it as a button.&lt;br /&gt;
&lt;br /&gt;
The author should follow name convention to avoid potential collisions with future additions into the spec predefined lists. Thus all names should be prefixed by &#039;x-&#039; like &#039;x-redbutton&#039; from example above.&lt;br /&gt;
&lt;br /&gt;
==Music sheet example==&lt;br /&gt;
&lt;br /&gt;
To make a music sheet accessible the web app may introduce bunch of new roles, attributes and relations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roles:&lt;br /&gt;
  &#039;sheet&#039; - inherited from &#039;section&#039;&lt;br /&gt;
  &#039;note&#039; - inherited from &#039;image&#039;, describes the note&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;sheet&#039; attributes:&lt;br /&gt;
  instrument: DOMString,&lt;br /&gt;
  tempo: number/DOMString&lt;br /&gt;
  clef: DOMString&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; attributes:&lt;br /&gt;
  key: enum { C, D, E, F, G, A, H },&lt;br /&gt;
  alteration: enum { none, flat, sharp },&lt;br /&gt;
  octave: enum { ... },&lt;br /&gt;
  duration: number,&lt;br /&gt;
  effects: sequence&amp;lt;DOMString&amp;gt;, // tremolo, bend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role &#039;note&#039; relations:&lt;br /&gt;
  crescendo: [note, ...] a list a notes the crescendo is applied to&lt;br /&gt;
  diminuendo: [note, ...] a list a notes the diminuendo is applied to&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Surkov.alexander</name></author>
	</entry>
</feed>