Debugging accessibility with Chrome DevTools

Chrome for Developers · Intermediate ·📰 AI News & Updates ·4y ago

Key Takeaways

The video demonstrates how to use Chrome DevTools to debug accessibility issues in web applications, including running Lighthouse accessibility audits and manual testing with Chromevox. It also showcases the full page accessibility tree feature in Chrome DevTools to identify and fix accessibility bugs.

Full Transcript

[Music] hello i'm cynthia shelley lead program manager for accessibility on chrome and chrome os today i'm going to show you how to use the new full page accessibility tree in chrome dev tools to debug accessibility in your web applications to debug accessibility you need to do two things you need to find accessibility bugs and you need to fix them there's a lot more that goes into accessibility from design to coding standards to user testing but right now we're talking about one small piece of the process how to find bugs figure out what's causing them and fix them there are many automated tools to help you find accessibility bugs chrome dev tools includes an accessibility audit as part of lighthouse it's built right in so you don't need to buy or download anything it's optimized to reduce false positives so there won't be a lot of noise in your results and it provides links to developer docs that help you understand the error and some common approaches to fixing it the screenshot here shows the results of a test including controls that are missing accessible names more on that later and an image with no alternative or alt text to describe the image to users who can't see it that's one of the most common accessibility bugs it's important to note that automated accessibility checkers only find a subset of the issues on a page it can give you a good idea of the accessibility state of a page a poor score here indicates that the developer didn't follow best practices and likely has other bugs too fixing these issues doesn't mean that the page is ready to go but it's a good place to start you'll also need to test manually with screen readers and other assistive technology most automated tools don't test interaction like what happens when i activate this button can my screen reader find the menu it opens and they can't tell you if it makes sense for example a tool can tell you that the alt attribute is missing or empty the screenshot in the last slide did just that but it can't tell you if the words in that attribute describe the meaning of the image and its function in the page or if i tab through a page it can't tell you if that order makes sense now we'll do a demo showing how chrome devtools makes it easier to find and fix accessibility bugs first we'll run a lighthouse accessibility audit then we'll do some manual testing using chromevox the screen reader built into chrome os to explore a complex issue found by the tool this is friend per an example website we created with some known accessibility bugs first we'll run an accessibility audit with lighthouse which is built into the chrome devtools so open up the chrome dev tools on my chromebook i use ctrl shift i on mac it's option command i and on windows it's f12 i've got it all set up to run an accessibility report now i click generate report and it'll take a few seconds to examine the web page for known accessibility errors then it shows the score for this site 82 yellow not the worst but not great either and it shows the errors that it's found it won't find everything and we'll do some manual interactive testing in a minute but it found quite a few things here's a classic accessibility error image elements do not have alt attributes missing alt text these adorable baby goats don't have the text describing them to screen reader users users who can't see the picture this next one's a little more complex but the tool still was able to tell us something is wrong here it says arya toggle fields do not have accessible names okay so what's an aria-toggle field why does it need a name and what does that have to do with pictures of cats i mean okay everything has to do with pictures of cats so arya is a set of attributes that allows web developers to add extra accessibility information beyond what's built in to html elements this site must be using aria okay but why toggle field let's see if we can figure out what this thing is for it says share with above the pictures and above that is a text box that says what are you meowing about this is a social media site and i think we're supposed to be able to select which of our kitty friends we want to meow at today we can choose more than one so functionally it's a multiple selection control or a set of check boxes or toggle buttons that's why toggle so aria toggle field and it's an interactive control interactive controls all need accessible names so that users with assistive technology like screen readers can tell what the control is for so lighthouse has found a problem but why is it a problem a little bit of manual testing can show us so i'm going to try it with a screen reader first i'm going to close devtools so we get an experience similar to what end users have i'm on a chromebook so i'm going to use our built-in screen reader chromevox if you're on a chromebook you can turn it on with ctrl alt z there are screen readers for all major operating systems check your system docs for info about how to enable yours so let's look at those aria toggle fields chromebox spoke volume slider 75 chromebox spoken feedback is ready friendpor with chromevox you use search plus arrow keys to navigate around the content including content you can't reach with just the tab key the orange box shows chromevox focus friend complete what are shared checkbox checked press search plus space to toggle checkbox not checked press search plus space to toggle checkbox not checked press search plus space to toggle chromebox is reading them as checkbox the first one is checked and the other two are not checked checkbox is what's exposed to the user letting them know that they can select multiple items check boxes and toggles are functionally equivalent but checkbox is more familiar to screen reader users okay so that makes sense but it's not saying a name for them that's weird the names are right below the pictures even if i move chromebox cursor onto a text it doesn't get read out loud so this is clearly not the right behavior a chromebox user who can't see the screen will not be able to tell us which friends will get the message that could be awkward on the social media site that's a quick example of finding bugs with lighthouse and with manual testing okay so once you've found a bug how do you figure out what the problem is and how do you fix it before we start debugging let's talk for a minute about how web accessibility works chromevox gets its information from something called the accessibility tree the accessibility tree is a tree of accessibility objects that represent the content of the web page it's based on the dom but simplified to remove nodes with no semantic content the buttons and headings are there but spans and divs that are only for styling aren't there this example is a simple form the form element becomes the section in the accessibility tree the h2 type of cat is the first heading there are two radio buttons tuxedo like my cat and tabby those names come from the label elements there's another heading name your cat and that's the other h2 and a text box called cat's name which comes from the input these trees the dom and the accessibility tree represent the same thing in a slightly different way understanding this makes debugging accessibility issues a lot easier okay let's fix this bug first let's turn on the full page accessibility tree open dev tools on my chromebook i use ctrl shift i and on mac it's command option i on windows it's f12 go to the accessibility pane in the elements panel and check enable full page accessibility tree you'll need to reload devtools a blue button will appear at the top and once you've done that go to the elements panel you'll find a new button to switch to accessibility tree view you can toggle between accessibility tree view and the dom tree view with this button now we'll figure out what caused those bugs we saw before and what we need to do to fix them okay now we're ready to go back to friendpur and figure out what's causing this strange behavior i've got my full page accessibility tree up and i also have the accessibility panel up to show more detail first i'm going to select our duchess picture and see if i can figure out how it works in the accessibility tree it shows up as a checkbox which is what chromebook said too that makes sense next of a checkbox role though there's an empty string why doesn't it have a name let's look at the accessibility panel here we have aria attributes those are the attributes the developer added to the dom and computed properties those are the state the element has after all the different algorithms have been run looking in the accessibility panel we see that duchess has the aria labeled by attribute pointing to an element with the id of label1 it shows up in the computed properties too if the id were invalid it would be crossed out in the computed properties this seems like it should work that's weird in the computed properties we can click on the label id and it will take us to that element this is really useful for understanding how the elements are connected together the accessibility tree has many secondary relationships that aren't always obvious when looking at the dom label 1 has the role of label text that makes sense and it's highlighting the text duchess under her picture the text is right there we saw that the reference worked when we followed it in the dev tools why doesn't this work i'll try to expand the label text nope no children okay now we need to go over to the dom to see what's happening the same button we click to switch to the accessibility tree will toggle us back to the dom one really nice thing is that it keeps our place when we switch back and forth we're still on the duchess label only now we're looking at it in the dom here we can expand the label element and see what's inside of it oh look there's a span in there and it has aria hidden true on it remember earlier when we talked about how the accessibility tree doesn't include every dom node aria hidden equals true explicitly tells chrome to leave that node and all of its children out of the accessibility tree even if they'd normally be there it even says in the computed properties accessibility node is not exposed element is aria hidden if we switch back to the accessibility tree for a second while we have this selected we'll see that there are now two nodes showing up under the label text that are grayed out and say ignored let's switch back to the dom again and test our theory we can double click on true and change it to false false is the default for aria hidden so when you go to fix this bug for real you may want to remove the attribute entirely both the tree and the panel are live changes in the dawn will be reflected here too that's especially useful when debugging something that involves a lot of user interaction so we can switch back to the accessibility tree and see if this worked okay so there's a static text element with a string duchess inside the label text that looks promising and if we go up to our duchess profile picture check box it has the word duchess under it it's there too and it shows up in the accessibility tree checkbox duchess focusable equals true it's even in the computed properties name duchess so that seems like it's working let's try it with chromevox to see if it's really fixed so first i'll close the dev tools to emulate typical user experience even with the panel closed it keeps our edit to a dom in place so we can test them with chromevox i'll launch chromevox with ctrl alt z and use search right arrow to move to duchess chromebox spoke volume slider 75 chromebox spoken feedback is ready friend for friend for profile feed cirque sir prof chain complete what are you share with ellipsis duchess checkbox checked press search plus space to toggle it said the name the fix worked if i keep doing search right arrow we'll also see that the text duchess underneath the picture is no longer separately focused while barely jose and maria's text is check box not check check box not checked press search plus space to toggle that's because chromevox knows that the text is a label for the image checkbox and is smart enough to treat them as a single control there are a few use cases for aria hidden but it's also because of a lot of bugs like this one if you find yourself wanting to use it in your code think about whether there's a different way to achieve your goals of course editing the dom only fixes the bug on my browser and only until i refresh the page now that we know what the problem is we'd need to go into the source for the page and fix it there and we should have some real users who use screen readers and other at all day long try it out before we declare it really fixed debugging accessibility isn't much different than debugging anything else you still have to find bugs and you still have to fix them with the new full page accessibility tree in chrome dev tools it's now a lot easier to track down accessibility bugs you can see the accessibility tree for the whole page how it relates to baton and easily switch between them thank you for joining us today you can find out more about the accessibility features in chrome dev tools including the full page accessibility tree and lighthouse accessibility audits on the chrome developers blog and on web.dev you can learn more about accessibility at google on the keyword blog and at google.com accessibility and you can follow us on twitter at googleaccess all one word thank you and enjoy the rest of i o [Music] you

Original Description

To watch this keynote interpreted in American Sign Language (ASL), please click here → https://goo.gle/3LYclAp Learn how new features in Chrome DevTools can help you understand how accessibility works (or doesn't work!) in a web application. Find out how to track down what's causing an issue and fix it. Resources: Full Accessibility Tree in Chrome Dev Tools → https://goo.gle/36S1Wr1 Lighthouse Accessibility Audits → https://goo.gle/3LKYyNa Google Accessibility for Developers → https://goo.gle/3DNfekC Speaker: Cynthia Shelly Watch more: All Google I/O 2022 Sessions → https://goo.gle/IO22_AllSessions Web at I/O 2022 playlist → https://goo.gle/IO22_Web All Google I/O 2022 technical sessions → https://goo.gle/IO22_Sessions Subscribe to Google Chrome Developers → https://goo.gle/ChromeDevs #GoogleIO
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Chrome for Developers · Chrome for Developers · 0 of 60

← Previous Next →
1 Polymer Performance Patterns (The Polymer Summit 2015)
Polymer Performance Patterns (The Polymer Summit 2015)
Chrome for Developers
2 Polymer Power Tools (The Polymer Summit 2015)
Polymer Power Tools (The Polymer Summit 2015)
Chrome for Developers
3 Chrome Dev Summit 2014 – Chrome Case Studies
Chrome Dev Summit 2014 – Chrome Case Studies
Chrome for Developers
4 Web Directions Code 2015 round up
Web Directions Code 2015 round up
Chrome for Developers
5 Maintainable Code - HTTP203
Maintainable Code - HTTP203
Chrome for Developers
6 iron-ajax… wat?! -- Polycasts #26
iron-ajax… wat?! -- Polycasts #26
Chrome for Developers
7 The Guardian - Supercharged
The Guardian - Supercharged
Chrome for Developers
8 ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
Chrome for Developers
9 #AskPolymer: Rob answers all the questions ever -- Polycasts #27
#AskPolymer: Rob answers all the questions ever -- Polycasts #27
Chrome for Developers
10 The Future of JavaScript - HTTP203
The Future of JavaScript - HTTP203
Chrome for Developers
11 Data Binding 101 -- Polycasts #28
Data Binding 101 -- Polycasts #28
Chrome for Developers
12 The Guardian part 2 - Supercharged
The Guardian part 2 - Supercharged
Chrome for Developers
13 The Future of Web Audio: with Chris Wilson and Chris Lowis
The Future of Web Audio: with Chris Wilson and Chris Lowis
Chrome for Developers
14 Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome for Developers
15 Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Chrome for Developers
16 #AskPolymer: How do you make the show? -- Polycasts #29
#AskPolymer: How do you make the show? -- Polycasts #29
Chrome for Developers
17 Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Chrome for Developers
18 Binding to Objects -- Polycasts #30
Binding to Objects -- Polycasts #30
Chrome for Developers
19 Player FM - Supercharged
Player FM - Supercharged
Chrome for Developers
20 Where’s the Designer? #AskPolymer -- Polycasts #31
Where’s the Designer? #AskPolymer -- Polycasts #31
Chrome for Developers
21 Jake Beats Wikipedia - HTTP203
Jake Beats Wikipedia - HTTP203
Chrome for Developers
22 Supercharged Observers! -- Polycasts #32
Supercharged Observers! -- Polycasts #32
Chrome for Developers
23 Jai's Web blog - Supercharged
Jai's Web blog - Supercharged
Chrome for Developers
24 Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Chrome for Developers
25 What about internationalization? #AskPolymer -- Polycasts #33
What about internationalization? #AskPolymer -- Polycasts #33
Chrome for Developers
26 Developing for Billions (Chrome Dev Summit 2015)
Developing for Billions (Chrome Dev Summit 2015)
Chrome for Developers
27 Google+ Performance Improvement Comparison
Google+ Performance Improvement Comparison
Chrome for Developers
28 Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Chrome for Developers
29 Progressive Web Apps (Chrome Dev Summit 2015)
Progressive Web Apps (Chrome Dev Summit 2015)
Chrome for Developers
30 Instant Loading with Service Workers (Chrome Dev Summit 2015)
Instant Loading with Service Workers (Chrome Dev Summit 2015)
Chrome for Developers
31 Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Chrome for Developers
32 Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Chrome for Developers
33 Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Chrome for Developers
34 Polymer - State of the Union (Chrome Dev Summit 2015)
Polymer - State of the Union (Chrome Dev Summit 2015)
Chrome for Developers
35 Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Chrome for Developers
36 Introduction to RAIL (Chrome Dev Summit 2015)
Introduction to RAIL (Chrome Dev Summit 2015)
Chrome for Developers
37 DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
Chrome for Developers
38 RAIL in the real world (Chrome Dev Summit 2015)
RAIL in the real world (Chrome Dev Summit 2015)
Chrome for Developers
39 #ChromeDevSummit talks are up - W00T! -- Polycast #34
#ChromeDevSummit talks are up - W00T! -- Polycast #34
Chrome for Developers
40 V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
Chrome for Developers
41 Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Chrome for Developers
42 Owning your performance: RAIL (Chrome Dev Summit 2015)
Owning your performance: RAIL (Chrome Dev Summit 2015)
Chrome for Developers
43 HTTP/2 101 (Chrome Dev Summit 2015)
HTTP/2 101 (Chrome Dev Summit 2015)
Chrome for Developers
44 Leadership Panel (Chrome Dev Summit 2015)
Leadership Panel (Chrome Dev Summit 2015)
Chrome for Developers
45 Build Processes, Totally Tooling Tips (S2, Ep 5)
Build Processes, Totally Tooling Tips (S2, Ep 5)
Chrome for Developers
46 Accessibility (Chrome Dev Summit 2015)
Accessibility (Chrome Dev Summit 2015)
Chrome for Developers
47 Binding to Arrays -- Polycasts #35
Binding to Arrays -- Polycasts #35
Chrome for Developers
48 HTTP2 - HTTP203
HTTP2 - HTTP203
Chrome for Developers
49 Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome for Developers
50 Call For Submissions - Supercharged
Call For Submissions - Supercharged
Chrome for Developers
51 Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Chrome for Developers
52 Testing AJAX with Web Component Tester -- Polycasts #37
Testing AJAX with Web Component Tester -- Polycasts #37
Chrome for Developers
53 Slack: Extended Xmas Special - Supercharged
Slack: Extended Xmas Special - Supercharged
Chrome for Developers
54 Browser testing with Travis & Sauce Labs -- Polycasts #38
Browser testing with Travis & Sauce Labs -- Polycasts #38
Chrome for Developers
55 Optimize for production with Vulcanize -- Polycasts #39
Optimize for production with Vulcanize -- Polycasts #39
Chrome for Developers
56 Highlights from Chrome Dev Summit 2015
Highlights from Chrome Dev Summit 2015
Chrome for Developers
57 Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome for Developers
58 Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Chrome for Developers
59 How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
Chrome for Developers
60 Colors – DevTools Tonight #0 (Pilot)
Colors – DevTools Tonight #0 (Pilot)
Chrome for Developers

This video teaches how to use Chrome DevTools to identify and fix accessibility issues in web applications, including using Lighthouse audits and manual testing with screen readers. It's essential for developers to ensure their web applications are accessible to all users.

Key Takeaways
  1. Run a Lighthouse accessibility audit
  2. Do manual testing using Chromevox
  3. Explore a complex issue found by the tool
  4. Turn on the full page accessibility tree in Chrome DevTools
  5. Reload DevTools to enable the full page accessibility tree
  6. Switch to the accessibility tree view in the Elements panel
  7. Toggle between accessibility tree view and DOM tree view
  8. Select an element in the accessibility tree to view its properties
💡 The full page accessibility tree feature in Chrome DevTools can help identify and fix accessibility bugs by showing a secondary relationship that isn't always obvious when looking at the DOM.

Related AI Lessons

You Are Not Behind. The World Is.
You're not behind, the world is still adapting to AI, and it's okay to take your time to learn and grow
Medium · AI
Career choice with the advent of AI - pure Computer Science or learn software with a background of core engineering area
Learn how to choose between a Computer Science and Engineering career path or combining programming with a core engineering background in the age of AI
Dev.to AI
The AI Hype Cycle: Calm Before the Next Breakthrough?
Understand the AI hype cycle to anticipate the next breakthrough and make informed decisions
Medium · Programming
AI won’t replace scientists. It will make the current model of science obsolete
AI is not replacing scientists, but rather making the current model of science obsolete, enabling new forms of discovery and collaboration
Medium · Data Science
Up next
Motorist saved by human chain | 9 News Australia
9 News Australia
Watch →