the strange dom: or how i stopped learned to stop worrying and test for accessibility

20
The Strange DOM: Or How I Learned to Stop Worrying and Test For Accessibility

Upload: 1copenut

Post on 11-Feb-2017

215 views

Category:

Software


1 download

TRANSCRIPT

Page 1: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

The Strange DOM:

Or How I Learned to Stop Worrying

and Test For Accessibility

Page 2: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Trevor Pierce• User experience designer • Javascript mucker-arounder • Accessibility advocate and advisor

Page 3: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Accessibility is difficult…it starts out easy…but it ends up difficult.

Page 4: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Radio buttons:<fieldset id=“shipping-speed”> <legend>Select a shipping speed:</legend> <ul class="controlList" aria-labelledby=“shipping__header"> <li><label for="p3_opt1"><input id="p3_opt1" type="radio" name="shipping-radio" value="Standard" />Standard 3-5 Business Days</label></li> <li><label for="p3_opt2"><input id="p3_opt2" type="radio" name="shipping-radio" value="Two Day Air" />2 Day Air</label></li> <li><label for="p3_opt3"><input id="p3_opt3" type="radio" name="shipping-radio" value="Overnight" />Overnight Air</label></li> </ul> </fieldset>

Page 5: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Checkboxes:<h3 id="size__header">Sizes</h3> <ul class="controlList" aria-labelledby="size__header"> <li><label for="p2_opt1"><input id="p2_opt1" type="checkbox" name="extra small" value="Extra Small" />Extra Small</label></li> <li><label for="p2_opt2"><input id="p2_opt2" type="checkbox" name="small" value="Small" />Small</label></li> <li><label for="p2_opt3"><input id="p2_opt3" type="checkbox" name="medium" value="Medium" />Medium</label></li> <li><label for="p2_opt4"><input id="p2_opt4" type="checkbox" name="large" value="Large" />Large</label></li> <li><label for="p2_opt5"><input id="p2_opt5" type="checkbox" name="extra large" value="Extra Large" />Extra Large</label></li> </ul>

Page 6: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

“Tell no one of this.”

Page 7: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

1. Incomplete specs, no clear best practices

2. No clear guidance like other industrialized nations. Section 508? WCAG? Which standard?

3. Designers. Designers?!? (Let me explain.)

Some challenges:

Page 8: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

“This’ll be great.”

Page 9: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

• Tabs, • Mega menus, • Typeaheads, oh my! • These rich widgets are NOT accessible

without developer intervention

Designers like widgets:

Page 10: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

“So what now, funny man?” — Some testing strategies

Page 11: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

• Can’t account for all types of colorblindness • Screen reader testing is like 2-3 additional browsers • Error-prone, humans are better suited to logic and

judgment-call testing

Only human testing

Page 12: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Only human testing — The digital equivalent to…

Page 13: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

• More comprehensive than human testing alone • Can identify issues with static, and dynamic elements • Not as helpful after the fact • Longer remediation timelines, bigger budgets • More difficult to refactor code later

Production code scans

Page 14: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

Production code scans — The digital equivalent to…

Page 15: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

The new hotness — How I’m doing what it is I do

Page 16: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility
Page 17: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

• Fixtures to test HTML in isolation, one module at a time • Test suite loads a new fixture for each test • Suite tests click, focus, blur, keypress, and combo events • Suite runs aXe accessibility test after DOM manipulations • Human testing as a final check. Seeing is believing.

A new take on testing

Page 18: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

“Show us yer codez.”

Page 19: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

“Denouement”

Page 20: The Strange DOM: Or How I Stopped Learned to Stop Worrying and Test for Accessibility

• Read the specs, challenge the rules. I opened 3 bug fixes, just by reading, and referencing the WCAG spec.

• Advocate for QA (human, automated) in your projects • Write tests! Unit tests are cheap, and effective. • Fork and improve:

https://github.com/1Copenut/C3/tree/develop

Contribute to #a11y