Accessiblity 101 and JavaScript Frameworks

Aimee Maree Forsstrom
Aimee Maree ForsstromSoftware Consultant and Researcher at University of Adelaide
ACCESSIBILITY - 101
@AIMEE_MAREE
JAVASCRIPT FRAMEWORKS AND
1
GOVERNMENT MANDATED
POLICY AND ITS A HUMAN
RIGHT!
Legal Perspective
2
ENABLING AND ENHANCING
ACCESS FOR ALL TYPES OF
PEOPLE AND ASSISTIVE TOOLS
Human Perspective
3
ACCESSIBILE CODE CATERS
FOR A WIDER AUDIENCE AND A
LARGER USER BASE
The Client
4
WE INCLUDED TABINDEX=“1”
AND ROLE=“NAVIGATION" ON
ALL THE MENU LINKS!
Developer Perspective
5
6
THE MODERN DAY WEB IS
BUILT ON JAVASCRIPT
FRAMEWORKS
World Wide Web
7
JAVASCRIPT CAN’T BE MADE
ACCESSIBLE?
Myth
8
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
DOCUMENT.GETELEMENTBYID(“HTML”)
9
Backend JavaScript Frameworks (node.JS) perform
ServerSide processes which output HTML
The HTML code is sent with images, other
JavaScript libraries and CSS to the BROWSER
.html .js
.css .img
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
DOCUMENT.GETELEMENTBYID(“HTML”)
10
The files sent are processed in the BROWSER and turned
into tokens interpreted by DOM and the Accessibility API
HTML is rendered in the BROWSER to the end device
and interpreted by assistive technologies
HTML
CC BY-NC-SA @AIMEE_MAREE
HTML AND ACCESSIBILITY
HTML elements don't just make things look good thats CSS
HTML elements describe the type of information that is
conveyed <blockquote> <p> <img> <a>
Native HTML elements are implicit and declare their role,
name, properties and states to the Accessibility API
Assistive tools rely on the proper use of HTML elements to
accurately convey information
Aria tags can be used with Native HTML elements to convey
additional information to the Accessibility API
AFICIONADO.TECH
11
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ACCESSIBILITY STACK
12
ACCESSIBILITY API
ASSISTIVE TECHNOLOGY
BROWSER
OPERATING SYSTEM
THE DOM HAS ACCESSIBILITY
API TREE BUT JAVASCRIPT
DOES NOT SPEAK TO IT
Some Truth to the Myth
13
CC BY-NC-SA @AIMEE_MAREE
JAVASCRIPT AND HTML
Browsers, ScreenReaders, other tools read HTML elements
Backend JavaScript frameworks output HTML elements
Frameworks notoriously use <div> and <span> elements
for HTML however these elements are semantically neutral
HTML elements are translated to recognisable tokens used
by the DOM to render a webpage in a BROWSER
JavaScript can manipulate DOM tokens changing how the
HTML is rendered in the BROWSER
AFICIONADO.TECH
14
I WRITE JAVASCRIPT NOT
HTML!
JavaScript
15
YES, BUT, THE END USER SEES
THE HTML, SCREENREADERS
USE THE ACCESSIBILITY API
ScreenReader
16
THIS IS WHY ARIA WAS BORN
W3C Standards
17
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ARIA AND ASSISTIVE TECHNOLOGY
18
Accessibility API
Role
‣ Navigational landmarks
‣ Assest Types
‣ Widget Types
States and Properties
‣ Widgets
‣ Form
‣ Dynamic
‣ Value
DOM-implied hierarchy
State and Property Events
User Agent
Browser DOM
JavaScript
‣ Acts as the Controller
‣ Manipulates DOM
tokens
‣ Event-driven
‣ Can produce new
widget/s
Assistive
Technology
Interprets the HTML
output from the browser
Reads the information
presented in the HTML
and uses the HTML
elements found to
understand the type of
information presented
DATA DOCUMENT
ELEMENTUI
SO WHATS IMPORTANT TO THE
ACCESSIBILITY API?
Audience
19
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
NAME
Provides an accessible name for the element
For example: The form label tag becomes the
accessible name for the associated form field object
<label></label>
For image the alt tag provides the accessible name
<img></img>
20
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ROLE
Declares element type used to identify the purpose and
mapped to values in the accessibility API
Exposes a set of known actions to tools based on implied
behaviour of the role, example: role=“search”
Can define what behaviour to use when certain states or
properties with default values are not provided
<input type=“checkbox” id=“happy" checked>
<label for=“happy”>Code 2017 makes me hapy</label>
21
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
STATES
Conveys the current state of the element
Dynamic property expressing characteristics of an object
that may change in response to an action [user or script]
Represent associated data or user interaction
States declare interactions and grouped by Widget types,
Live region, drag and drop
<input type=“checkbox” id=“happy" checked>
<label for=“happy”>Code 2017 makes me happy</label>
22
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
PROPERTIES
Attributes that are essential to the nature of a given object or
represent a data value associated with the object
Less likely to change during the app life cycle
Properties declare both informative and declarative attributes
Grouped by Widget types, Live region, drag and drop,
relationship
<input type=“checkbox” id=“happy" checked>
<label for=“happy”>Code 2017 makes me hapy</label> I
23
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
NAME, ROLE, PROPERTIES, STATES
24
10
ACCESSIBILITY
API
Name = Search
Value = (none)
Role = Button
State = default, focusable
Description = “Search this Site”
Aria-live = “polite”
SO WHAT DOES THIS MEAN
FOR CUSTOM ELEMENTS /
WEB COMPONENTS
sensible developer
25
CC BY-NC-SA @AIMEE_MAREE
CUSTOM HTML ELEMENTS ACROSS FRAMEWORKS
Assistive tools rely on W3C Standards like WCAG which in-turn
rely on the HTML standard
JS Frameworks are powerful for developers quick to prototype
Power can be a bad thing when standards are not applied
Depends on the framework, some frameworks have Aria calls built
into their components, some make more use of native elements.
So I don't have to worry about HTML then? Well its JS yes, but
your still injecting HTML code and that is what needs to be
accessible.
AFICIONADO.TECH
26
ANGULAR AND A11Y
Google
27
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ANGULAR
Allows you to create custom HTML elements so you MUST add
aria tags to establish role, state, properties
Has ngAria initiative that enables common ARIA attributes to be
easily used on elements
Mature framework community so lots of forum and group
discussions around best practice and examples of techniques
Has community focused people on the core team who are
experienced and passionate about a11y more mature framework
which means there are heaps of examples on the web
Uses Google Material Design approach
28
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ANGULAR AND ARIA
Angular has ngAria this includes a basic set of Aria tags that
can be called and used in components
angular.module('myApp', ['ngAria'])...
<md-checkbox ng-disabled="disabled"></md-checkbox>
is read by the browser as:
<md-checkbox disabled aria-disabled="true"></md-checkbox>
29
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
NGMODEL THE HEAT LIFTER FOR NGARIA
ngModel calls to ngAria which will check the element for role or type
of checkbox, radio, range or textbox, ngAria adds tabIndex and then
will dynamically bind and update ARIA attributes:
• aria-checked
• aria-valuemin
• aria-valuemax
• aria-valuenow
• aria-invalid
• aria-required
• aria-readonly
• aria-disabled
30
EMBER AND A11Y
Seperate Ember Sponsor Companies
31
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
EMBER
Accessibilty was always an after thought for the ember
leadership though recently more of a focus has been
taken
Allows you to create custom HTML elements so you MUST
add aria tags to establish role, state, properties
Has role built into native components which can be
modified
Growing a11y initiative to create a toolset for accessibility
to be added into projects https://github.com/ember-
a11y
32
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
EMBER AND THE VIRTUAL DOM
Ember talks to a Virtual DOM
DOM updates are batch processed so this means there
can be a lag
Data bindings and transitions mean whats on the screen
is not always what the Screen Reader sees as focus is lost
Need to add specific calls in components for tabindex,
ariaRole, aria-label, keyDown
use ember-a11y replace {{outlet}} with {{focusing outlet}}
33
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
EMBER BUTTON
Ember JS Code
App.HappyButtonComponent = Ember.Component.extend({
tagName: 'happy-button',
nameBinding: 'happy.name',
attributeBindings: ['label:aria-label',
'tabindex'],
label: ‘Are you Happy?”,
tabindex: -1,
ariaRole: ‘button',
click: function(event) {
alert('Yes');
},
keyDown: function(event) {
if (event.keyCode == 13 || event.keyCode == 32)
{
this.click(event);
}
}
});
34
Rendered HTML
<happy-button aria-label=“Are
you Happy?" tabindex="1"
role="button">
Are you Happy?
</happy-button>
REACT AND A11Y
Facebook
35
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
REACT
Allows you to create custom HTML elements so you MUST
add aria tags to establish role, state, properties
Has a native Accessibilty API must be implemented in
parent view
Advance set of Aria features built into components
Has react a11y tool to perform an automated a11y check
Mature framework that has a focused a11y initiative
Growing developer tool set and tutorials around web
accessibility
36
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
REACT ACCESSIBILITY API
React Accessibility API is set on the parent component
and it will then traverse down the tree to its children
<View
accessible={true}
style={{
flex: 1,
backgroundColor: 'white',
}}>
<Text>Some example text here</Text>
<Text>Some more engaging text here</Text>
<AdsManagerStatus
accessibilityLabel={'Status ' + this.props.status}
status={this.props.status}
/>
</View>
37
POLYMER AND A11Y
Google
38
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
POLYMER
Allows you to create custom HTML elements so you MUST add aria
tags to establish role, state, properties
Has common Aria calls and design concepts built into the native
framework elements
Uses Google Material Design approach
Early Framework and works on web components concepts not yet
implemented across all browsers had to create a similar
experience for Screen Readers
39
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
DOM, SHADOW DOM AND SHADY DOM
Polymer allows you to take use of the Shadow DOM
Because Shadow DOM is not available on all platforms
Polymer allows use of Shady CSS Polyfills and Shady DOM
However you can talk straight to the DOM and ignore the
others
tabindex [focus] and role needs to be mapped to the
custom element to avoid differences in Shadow DOM
implementation
Do not use IDs in your shadow DOM this is great for CSS
not so good for accessibility focus and binding
40
THE KEY PROBLEMS ARE
INHERENT IN THEM ALL NO
ONE FRAMEWORK IS QUEEN
FRAMEWORK REALITY
41
CC BY-NC-SA @AIMEE_MAREE
ALL FRAMEWORKS SAME PROBLEMS
Lack of use of Native HTML elements
Enforce use of custom elements and DOM declarations
Loss of Focus order due to DOM restructuring
Overuse of Aria tags - Developer must understand
expected element interactions
Accessibility as an after thought
AFICIONADO.TECH
42
UNDERSTANDING AND LOVING
WEB STANDARDS
THE PRESENTER
43
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
WAG, WAI-ARIA, W3C AND STANDARDS
WCAG: guidelines for accessibility standards
Wai-Aria: set of roles, properties and states that define
accessibility API tokens to the DOM, when not present
Understand HTML elements and where to use them
Validate your code with W3C HTML and CSS, understand
needed compromise/workarounds for browsers
Check code with automated accessibility test [at least]
44
CREATE A 1-TO-1 MAPPING
BETWEEN ARIA ROLES AND
CUSTOM ELEMENTS.
Web Component Best Practice GURU
45
TOP TIPS FOR CUSTOM
ELEMENTS
HOMEWORK
46
CC BY-NC-SA @AIMEE_MAREE
ACCESSIBILITY ISSUES FOR CUSTOM ELEMENTS
Custom HTML elements have NO state, roles, properties
The developer states this information by using Aria tags
Overuse of Aria tags, use of too many Aria tags when
communicating purpose of the element
Control of tab focus for keyboard, problematic when
rebuilding DOM needs deep level of focus
Misuse of Aria-live states to announce dynamic areas to
Screen readers leads to a very verbose experience
AFICIONADO.TECH
47
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
ACCEPTING THE KEY PITFALLS
More precise approach taken to ensure Aria roles and
states are communicated to the DOM
Working with Shadow DOM, Shady DOM, Virtual DOM,
Polyfills
Sometimes its impossible to use Native HTML Elements
Sometimes your retrofitting a11y into an older project
Focus on leading, bleeding edge technology means
accessibility is an after thought and retro fitted
48
SOME QUICK CODE
APPROACHES TO PRACTICE
FUTURE YOU
49
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
SOME CODE APPROACH TAKEAWAYS
Native HTML elements where possible
When using custom elements YOU declare their ROLE,
STATE and Properties functions to the DOM
Focus CSS class to highlight elements when receive
tabfocus
Manage focus order check and check across
ScreenReaders
Use landmarks correctly and never apply on the body
50
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
CODE APPROACHES…. CONTINUED
Create custom checkboxes with role=checkbox, aria-
checked, aria-disabled, aria-required, and wire up
keyboard events
Convey the interaction of the element, if its a button is the
interaction expected a space or enter key press?
Add focus ONLY when not using link type HTML elements
tabindex=“0” or “1” do not increment
tabindex=“0” will mean that your custom element follows
the order of structure that the DOM sees
51
CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH
REMEMBER USE NATIVE WHEN POSSIBLE
<!-- INCORRECT -->
<DIV (CLICK)="NAVIGATETOABOUT()"
CLASS="BTN">
ABOUT
</DIV>
<!-- CORRECT -->
<A ROUTERLINK="ABOUT" CLASS="BTN">
ABOUT
</A>
Span and DIV are non semantic elements avoid them
where it makes sense to use the Native HTML element
52
ACCESSIBILITY ENGINEERING
IS NOT SIMPLE AND ITS A
MOVING TARGET!
Reality Calling
53
GO FORTH AND MAKE THE WEB
MORE ACCESSIBLE…
The Presenter
54
55
1 of 55

Recommended

DOM and Accessibility API Communication by
DOM and Accessibility API CommunicationDOM and Accessibility API Communication
DOM and Accessibility API CommunicationAimee Maree Forsstrom
595 views32 slides
AI: Mobile Apps That Understands Your Intention When You Typed by
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedMarvin Heng
205 views26 slides
OpenSocial Intro by
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
2.7K views57 slides
Sviluppare App per Office 2013 e SharePoint 2013 by
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Giuseppe Marchi
1.1K views26 slides
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up... by
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...marcocasario
1.9K views75 slides
An api is not "yet another feature" by
An api is not "yet another feature"An api is not "yet another feature"
An api is not "yet another feature"Shay Weiner
5.5K views50 slides

More Related Content

Similar to Accessiblity 101 and JavaScript Frameworks

Resume latest Update by
Resume latest UpdateResume latest Update
Resume latest UpdateVaibhav soni
362 views7 slides
Introduction to Shiny for building web apps in R by
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in RPaul Richards
10.5K views17 slides
Serverless Single Page Apps with React and Redux at ItCamp 2017 by
Serverless Single Page Apps with React and Redux at ItCamp 2017Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Melania Andrisan (Danciu)
1.4K views65 slides
Android accessibility for developers and QA by
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QATed Drake
25.4K views29 slides
HTML5 Up and Running by
HTML5 Up and RunningHTML5 Up and Running
HTML5 Up and RunningCodemotion
1.6K views122 slides
Write once, ship multiple times by
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple timesŽeljko Plesac
184 views78 slides

Similar to Accessiblity 101 and JavaScript Frameworks (20)

Resume latest Update by Vaibhav soni
Resume latest UpdateResume latest Update
Resume latest Update
Vaibhav soni362 views
Introduction to Shiny for building web apps in R by Paul Richards
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in R
Paul Richards10.5K views
Android accessibility for developers and QA by Ted Drake
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
Ted Drake25.4K views
HTML5 Up and Running by Codemotion
HTML5 Up and RunningHTML5 Up and Running
HTML5 Up and Running
Codemotion1.6K views
Write once, ship multiple times by Željko Plesac
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple times
Željko Plesac184 views
Introduction to interactive data visualisation using R Shiny by anamarisaguedes
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shiny
anamarisaguedes186 views
API Technical Writing by Sarah Maddox
API Technical WritingAPI Technical Writing
API Technical Writing
Sarah Maddox22.5K views
Bootstrapping an App for Launch by Craig Phares
Bootstrapping an App for LaunchBootstrapping an App for Launch
Bootstrapping an App for Launch
Craig Phares252 views
Integrating WordPress With Web APIs by randyhoyt
Integrating WordPress With Web APIsIntegrating WordPress With Web APIs
Integrating WordPress With Web APIs
randyhoyt8.6K views
Daniel Egan Msdn Tech Days Oc by Daniel Egan
Daniel Egan Msdn Tech Days OcDaniel Egan Msdn Tech Days Oc
Daniel Egan Msdn Tech Days Oc
Daniel Egan1.3K views
Reinventing Identity and Social Graphs with Digits by Romain Huet
Reinventing Identity and Social Graphs with DigitsReinventing Identity and Social Graphs with Digits
Reinventing Identity and Social Graphs with Digits
Romain Huet636 views
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation) by contest-theta360
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)
RICOH THETA x IoT Developers Contest : Cloud API Seminar (2nd installation)
contest-theta3601.3K views
Criteo Infrastructure (Platform) Meetup by Ibrahim Abubakari
Criteo Infrastructure (Platform) MeetupCriteo Infrastructure (Platform) Meetup
Criteo Infrastructure (Platform) Meetup
Ibrahim Abubakari1.6K views
Zero to Drupal in 60 Days with Acquia Lightning by Rachel Wandishin
Zero to Drupal in 60 Days with Acquia LightningZero to Drupal in 60 Days with Acquia Lightning
Zero to Drupal in 60 Days with Acquia Lightning
Rachel Wandishin739 views
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I... by Amazon Web Services
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Amazon Web Services7.6K views
7 network programmability concepts python-ansible by SagarR24
7 network programmability concepts python-ansible7 network programmability concepts python-ansible
7 network programmability concepts python-ansible
SagarR24260 views
Training thethings.iO by Marc Pous
Training thethings.iOTraining thethings.iO
Training thethings.iO
Marc Pous496 views
viWave Study Group - Introduction to Google Android Development - Chapter 23 ... by Ted Chien
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
Ted Chien856 views

More from Aimee Maree Forsstrom

AI - PAST, PRESENT, FUTURE.pptx by
AI - PAST, PRESENT, FUTURE.pptxAI - PAST, PRESENT, FUTURE.pptx
AI - PAST, PRESENT, FUTURE.pptxAimee Maree Forsstrom
46 views22 slides
Pioneering Technology - My Story by
Pioneering Technology - My StoryPioneering Technology - My Story
Pioneering Technology - My StoryAimee Maree Forsstrom
10 views36 slides
Machine Learning ate my homework by
Machine Learning ate my homeworkMachine Learning ate my homework
Machine Learning ate my homeworkAimee Maree Forsstrom
442 views20 slides
Accessibility, SEO and Joomla by
Accessibility, SEO and JoomlaAccessibility, SEO and Joomla
Accessibility, SEO and JoomlaAimee Maree Forsstrom
186 views37 slides
The Good, The Bad, The Voiceover - ios Accessibility by
The Good, The Bad, The Voiceover - ios AccessibilityThe Good, The Bad, The Voiceover - ios Accessibility
The Good, The Bad, The Voiceover - ios AccessibilityAimee Maree Forsstrom
974 views30 slides
Javascript Framework Acessibiliity Review by
Javascript Framework Acessibiliity ReviewJavascript Framework Acessibiliity Review
Javascript Framework Acessibiliity ReviewAimee Maree Forsstrom
487 views36 slides

More from Aimee Maree Forsstrom(20)

Govhack - Collections of World War One Connecting the Dots by Aimee Maree Forsstrom
Govhack - Collections of World War One Connecting the DotsGovhack - Collections of World War One Connecting the Dots
Govhack - Collections of World War One Connecting the Dots
FirefoxOS and its use of Linux (a deep dive into Gonk architecture) by Aimee Maree Forsstrom
FirefoxOS and its use of Linux (a deep dive into Gonk architecture)FirefoxOS and its use of Linux (a deep dive into Gonk architecture)
FirefoxOS and its use of Linux (a deep dive into Gonk architecture)

Recently uploaded

Penetration Testing for Cybersecurity Professionals by
Penetration Testing for Cybersecurity ProfessionalsPenetration Testing for Cybersecurity Professionals
Penetration Testing for Cybersecurity Professionals211 Check
52 views17 slides
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download by
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink DownloadAPNIC
159 views30 slides
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx by
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxCracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxLeasedLinesQuote
5 views8 slides
Affiliate Marketing by
Affiliate MarketingAffiliate Marketing
Affiliate MarketingNavin Dhanuka
21 views30 slides
WITS Deck by
WITS DeckWITS Deck
WITS DeckW.I.T.S.
37 views22 slides
Liberando a produccion con confidencia.pdf by
Liberando a produccion con confidencia.pdfLiberando a produccion con confidencia.pdf
Liberando a produccion con confidencia.pdfAndres Almiray
8 views49 slides

Recently uploaded(15)

Penetration Testing for Cybersecurity Professionals by 211 Check
Penetration Testing for Cybersecurity ProfessionalsPenetration Testing for Cybersecurity Professionals
Penetration Testing for Cybersecurity Professionals
211 Check52 views
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download by APNIC
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
APNIC159 views
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx by LeasedLinesQuote
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxCracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
WITS Deck by W.I.T.S.
WITS DeckWITS Deck
WITS Deck
W.I.T.S.37 views
Liberando a produccion con confidencia.pdf by Andres Almiray
Liberando a produccion con confidencia.pdfLiberando a produccion con confidencia.pdf
Liberando a produccion con confidencia.pdf
Andres Almiray8 views
cis5-Project-11a-Harry Lai by harrylai126
cis5-Project-11a-Harry Laicis5-Project-11a-Harry Lai
cis5-Project-11a-Harry Lai
harrylai1269 views
40th TWNIC Open Policy Meeting: APNIC PDP update by APNIC
40th TWNIC Open Policy Meeting: APNIC PDP update40th TWNIC Open Policy Meeting: APNIC PDP update
40th TWNIC Open Policy Meeting: APNIC PDP update
APNIC151 views
The Dark Web : Hidden Services by Anshu Singh
The Dark Web : Hidden ServicesThe Dark Web : Hidden Services
The Dark Web : Hidden Services
Anshu Singh23 views
ATPMOUSE_융합2조.pptx by kts120898
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptx
kts12089835 views
40th TWNIC Open Policy Meeting: A quick look at QUIC by APNIC
40th TWNIC Open Policy Meeting: A quick look at QUIC40th TWNIC Open Policy Meeting: A quick look at QUIC
40th TWNIC Open Policy Meeting: A quick look at QUIC
APNIC152 views

Accessiblity 101 and JavaScript Frameworks

  • 2. GOVERNMENT MANDATED POLICY AND ITS A HUMAN RIGHT! Legal Perspective 2
  • 3. ENABLING AND ENHANCING ACCESS FOR ALL TYPES OF PEOPLE AND ASSISTIVE TOOLS Human Perspective 3
  • 4. ACCESSIBILE CODE CATERS FOR A WIDER AUDIENCE AND A LARGER USER BASE The Client 4
  • 5. WE INCLUDED TABINDEX=“1” AND ROLE=“NAVIGATION" ON ALL THE MENU LINKS! Developer Perspective 5
  • 6. 6
  • 7. THE MODERN DAY WEB IS BUILT ON JAVASCRIPT FRAMEWORKS World Wide Web 7
  • 8. JAVASCRIPT CAN’T BE MADE ACCESSIBLE? Myth 8
  • 9. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH DOCUMENT.GETELEMENTBYID(“HTML”) 9 Backend JavaScript Frameworks (node.JS) perform ServerSide processes which output HTML The HTML code is sent with images, other JavaScript libraries and CSS to the BROWSER .html .js .css .img
  • 10. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH DOCUMENT.GETELEMENTBYID(“HTML”) 10 The files sent are processed in the BROWSER and turned into tokens interpreted by DOM and the Accessibility API HTML is rendered in the BROWSER to the end device and interpreted by assistive technologies HTML
  • 11. CC BY-NC-SA @AIMEE_MAREE HTML AND ACCESSIBILITY HTML elements don't just make things look good thats CSS HTML elements describe the type of information that is conveyed <blockquote> <p> <img> <a> Native HTML elements are implicit and declare their role, name, properties and states to the Accessibility API Assistive tools rely on the proper use of HTML elements to accurately convey information Aria tags can be used with Native HTML elements to convey additional information to the Accessibility API AFICIONADO.TECH 11
  • 12. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ACCESSIBILITY STACK 12 ACCESSIBILITY API ASSISTIVE TECHNOLOGY BROWSER OPERATING SYSTEM
  • 13. THE DOM HAS ACCESSIBILITY API TREE BUT JAVASCRIPT DOES NOT SPEAK TO IT Some Truth to the Myth 13
  • 14. CC BY-NC-SA @AIMEE_MAREE JAVASCRIPT AND HTML Browsers, ScreenReaders, other tools read HTML elements Backend JavaScript frameworks output HTML elements Frameworks notoriously use <div> and <span> elements for HTML however these elements are semantically neutral HTML elements are translated to recognisable tokens used by the DOM to render a webpage in a BROWSER JavaScript can manipulate DOM tokens changing how the HTML is rendered in the BROWSER AFICIONADO.TECH 14
  • 15. I WRITE JAVASCRIPT NOT HTML! JavaScript 15
  • 16. YES, BUT, THE END USER SEES THE HTML, SCREENREADERS USE THE ACCESSIBILITY API ScreenReader 16
  • 17. THIS IS WHY ARIA WAS BORN W3C Standards 17
  • 18. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ARIA AND ASSISTIVE TECHNOLOGY 18 Accessibility API Role ‣ Navigational landmarks ‣ Assest Types ‣ Widget Types States and Properties ‣ Widgets ‣ Form ‣ Dynamic ‣ Value DOM-implied hierarchy State and Property Events User Agent Browser DOM JavaScript ‣ Acts as the Controller ‣ Manipulates DOM tokens ‣ Event-driven ‣ Can produce new widget/s Assistive Technology Interprets the HTML output from the browser Reads the information presented in the HTML and uses the HTML elements found to understand the type of information presented DATA DOCUMENT ELEMENTUI
  • 19. SO WHATS IMPORTANT TO THE ACCESSIBILITY API? Audience 19
  • 20. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH NAME Provides an accessible name for the element For example: The form label tag becomes the accessible name for the associated form field object <label></label> For image the alt tag provides the accessible name <img></img> 20
  • 21. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ROLE Declares element type used to identify the purpose and mapped to values in the accessibility API Exposes a set of known actions to tools based on implied behaviour of the role, example: role=“search” Can define what behaviour to use when certain states or properties with default values are not provided <input type=“checkbox” id=“happy" checked> <label for=“happy”>Code 2017 makes me hapy</label> 21
  • 22. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH STATES Conveys the current state of the element Dynamic property expressing characteristics of an object that may change in response to an action [user or script] Represent associated data or user interaction States declare interactions and grouped by Widget types, Live region, drag and drop <input type=“checkbox” id=“happy" checked> <label for=“happy”>Code 2017 makes me happy</label> 22
  • 23. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH PROPERTIES Attributes that are essential to the nature of a given object or represent a data value associated with the object Less likely to change during the app life cycle Properties declare both informative and declarative attributes Grouped by Widget types, Live region, drag and drop, relationship <input type=“checkbox” id=“happy" checked> <label for=“happy”>Code 2017 makes me hapy</label> I 23
  • 24. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH NAME, ROLE, PROPERTIES, STATES 24 10 ACCESSIBILITY API Name = Search Value = (none) Role = Button State = default, focusable Description = “Search this Site” Aria-live = “polite”
  • 25. SO WHAT DOES THIS MEAN FOR CUSTOM ELEMENTS / WEB COMPONENTS sensible developer 25
  • 26. CC BY-NC-SA @AIMEE_MAREE CUSTOM HTML ELEMENTS ACROSS FRAMEWORKS Assistive tools rely on W3C Standards like WCAG which in-turn rely on the HTML standard JS Frameworks are powerful for developers quick to prototype Power can be a bad thing when standards are not applied Depends on the framework, some frameworks have Aria calls built into their components, some make more use of native elements. So I don't have to worry about HTML then? Well its JS yes, but your still injecting HTML code and that is what needs to be accessible. AFICIONADO.TECH 26
  • 28. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ANGULAR Allows you to create custom HTML elements so you MUST add aria tags to establish role, state, properties Has ngAria initiative that enables common ARIA attributes to be easily used on elements Mature framework community so lots of forum and group discussions around best practice and examples of techniques Has community focused people on the core team who are experienced and passionate about a11y more mature framework which means there are heaps of examples on the web Uses Google Material Design approach 28
  • 29. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ANGULAR AND ARIA Angular has ngAria this includes a basic set of Aria tags that can be called and used in components angular.module('myApp', ['ngAria'])... <md-checkbox ng-disabled="disabled"></md-checkbox> is read by the browser as: <md-checkbox disabled aria-disabled="true"></md-checkbox> 29
  • 30. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH NGMODEL THE HEAT LIFTER FOR NGARIA ngModel calls to ngAria which will check the element for role or type of checkbox, radio, range or textbox, ngAria adds tabIndex and then will dynamically bind and update ARIA attributes: • aria-checked • aria-valuemin • aria-valuemax • aria-valuenow • aria-invalid • aria-required • aria-readonly • aria-disabled 30
  • 31. EMBER AND A11Y Seperate Ember Sponsor Companies 31
  • 32. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH EMBER Accessibilty was always an after thought for the ember leadership though recently more of a focus has been taken Allows you to create custom HTML elements so you MUST add aria tags to establish role, state, properties Has role built into native components which can be modified Growing a11y initiative to create a toolset for accessibility to be added into projects https://github.com/ember- a11y 32
  • 33. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH EMBER AND THE VIRTUAL DOM Ember talks to a Virtual DOM DOM updates are batch processed so this means there can be a lag Data bindings and transitions mean whats on the screen is not always what the Screen Reader sees as focus is lost Need to add specific calls in components for tabindex, ariaRole, aria-label, keyDown use ember-a11y replace {{outlet}} with {{focusing outlet}} 33
  • 34. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH EMBER BUTTON Ember JS Code App.HappyButtonComponent = Ember.Component.extend({ tagName: 'happy-button', nameBinding: 'happy.name', attributeBindings: ['label:aria-label', 'tabindex'], label: ‘Are you Happy?”, tabindex: -1, ariaRole: ‘button', click: function(event) { alert('Yes'); }, keyDown: function(event) { if (event.keyCode == 13 || event.keyCode == 32) { this.click(event); } } }); 34 Rendered HTML <happy-button aria-label=“Are you Happy?" tabindex="1" role="button"> Are you Happy? </happy-button>
  • 36. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH REACT Allows you to create custom HTML elements so you MUST add aria tags to establish role, state, properties Has a native Accessibilty API must be implemented in parent view Advance set of Aria features built into components Has react a11y tool to perform an automated a11y check Mature framework that has a focused a11y initiative Growing developer tool set and tutorials around web accessibility 36
  • 37. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH REACT ACCESSIBILITY API React Accessibility API is set on the parent component and it will then traverse down the tree to its children <View accessible={true} style={{ flex: 1, backgroundColor: 'white', }}> <Text>Some example text here</Text> <Text>Some more engaging text here</Text> <AdsManagerStatus accessibilityLabel={'Status ' + this.props.status} status={this.props.status} /> </View> 37
  • 39. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH POLYMER Allows you to create custom HTML elements so you MUST add aria tags to establish role, state, properties Has common Aria calls and design concepts built into the native framework elements Uses Google Material Design approach Early Framework and works on web components concepts not yet implemented across all browsers had to create a similar experience for Screen Readers 39
  • 40. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH DOM, SHADOW DOM AND SHADY DOM Polymer allows you to take use of the Shadow DOM Because Shadow DOM is not available on all platforms Polymer allows use of Shady CSS Polyfills and Shady DOM However you can talk straight to the DOM and ignore the others tabindex [focus] and role needs to be mapped to the custom element to avoid differences in Shadow DOM implementation Do not use IDs in your shadow DOM this is great for CSS not so good for accessibility focus and binding 40
  • 41. THE KEY PROBLEMS ARE INHERENT IN THEM ALL NO ONE FRAMEWORK IS QUEEN FRAMEWORK REALITY 41
  • 42. CC BY-NC-SA @AIMEE_MAREE ALL FRAMEWORKS SAME PROBLEMS Lack of use of Native HTML elements Enforce use of custom elements and DOM declarations Loss of Focus order due to DOM restructuring Overuse of Aria tags - Developer must understand expected element interactions Accessibility as an after thought AFICIONADO.TECH 42
  • 43. UNDERSTANDING AND LOVING WEB STANDARDS THE PRESENTER 43
  • 44. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH WAG, WAI-ARIA, W3C AND STANDARDS WCAG: guidelines for accessibility standards Wai-Aria: set of roles, properties and states that define accessibility API tokens to the DOM, when not present Understand HTML elements and where to use them Validate your code with W3C HTML and CSS, understand needed compromise/workarounds for browsers Check code with automated accessibility test [at least] 44
  • 45. CREATE A 1-TO-1 MAPPING BETWEEN ARIA ROLES AND CUSTOM ELEMENTS. Web Component Best Practice GURU 45
  • 46. TOP TIPS FOR CUSTOM ELEMENTS HOMEWORK 46
  • 47. CC BY-NC-SA @AIMEE_MAREE ACCESSIBILITY ISSUES FOR CUSTOM ELEMENTS Custom HTML elements have NO state, roles, properties The developer states this information by using Aria tags Overuse of Aria tags, use of too many Aria tags when communicating purpose of the element Control of tab focus for keyboard, problematic when rebuilding DOM needs deep level of focus Misuse of Aria-live states to announce dynamic areas to Screen readers leads to a very verbose experience AFICIONADO.TECH 47
  • 48. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH ACCEPTING THE KEY PITFALLS More precise approach taken to ensure Aria roles and states are communicated to the DOM Working with Shadow DOM, Shady DOM, Virtual DOM, Polyfills Sometimes its impossible to use Native HTML Elements Sometimes your retrofitting a11y into an older project Focus on leading, bleeding edge technology means accessibility is an after thought and retro fitted 48
  • 49. SOME QUICK CODE APPROACHES TO PRACTICE FUTURE YOU 49
  • 50. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH SOME CODE APPROACH TAKEAWAYS Native HTML elements where possible When using custom elements YOU declare their ROLE, STATE and Properties functions to the DOM Focus CSS class to highlight elements when receive tabfocus Manage focus order check and check across ScreenReaders Use landmarks correctly and never apply on the body 50
  • 51. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH CODE APPROACHES…. CONTINUED Create custom checkboxes with role=checkbox, aria- checked, aria-disabled, aria-required, and wire up keyboard events Convey the interaction of the element, if its a button is the interaction expected a space or enter key press? Add focus ONLY when not using link type HTML elements tabindex=“0” or “1” do not increment tabindex=“0” will mean that your custom element follows the order of structure that the DOM sees 51
  • 52. CC BY-NC-SA @AIMEE_MAREE AFICIONADO.TECH REMEMBER USE NATIVE WHEN POSSIBLE <!-- INCORRECT --> <DIV (CLICK)="NAVIGATETOABOUT()" CLASS="BTN"> ABOUT </DIV> <!-- CORRECT --> <A ROUTERLINK="ABOUT" CLASS="BTN"> ABOUT </A> Span and DIV are non semantic elements avoid them where it makes sense to use the Native HTML element 52
  • 53. ACCESSIBILITY ENGINEERING IS NOT SIMPLE AND ITS A MOVING TARGET! Reality Calling 53
  • 54. GO FORTH AND MAKE THE WEB MORE ACCESSIBLE… The Presenter 54
  • 55. 55