{"id":1065,"date":"2021-04-08T18:00:11","date_gmt":"2021-04-08T16:00:11","guid":{"rendered":"http:\/\/blogs.igalia.com\/jaragunde\/?p=1065"},"modified":"2021-07-05T11:42:34","modified_gmt":"2021-07-05T09:42:34","slug":"a-recap-of-chromium-dialog-accessibility-enhancements","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/jaragunde\/2021\/04\/a-recap-of-chromium-dialog-accessibility-enhancements\/","title":{"rendered":"A recap of Chromium dialog accessibility enhancements"},"content":{"rendered":"<p>It&#8217;s been a bit more than a year since I started working on Chromium accessibility. Although I&#8217;ve worked on several kinds of issues, a lot of them had to do with UI dialogs of some kind.  Browser interfaces present many kinds of dialogs and these problems affected  all the desktop platforms. This post is a recap of all the kinds of things that have been fixed related with different uses of dialogs in Chromium!<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/bubble-cloud.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/bubble-cloud-300x216.png\" alt=\"\" width=\"300\" height=\"216\" class=\"aligncenter size-medium wp-image-1089\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/bubble-cloud-300x216.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/bubble-cloud-416x300.png 416w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/bubble-cloud.png 681w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<h3>JavaScript prompt dialogs<\/h3>\n<p>Several JavaScript things cause dialogs to be shown:  Things like <code>alert()<\/code>, <code>prompt()<\/code> or even in certain cases the <code>window.beforeunload<\/code> event (if it is a function which returns a string, this is presented in a dialog before unload happens).  These were reported in <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=779501\">#779501<\/a>, <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=1164927\">#1164927<\/a> and <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=1166370\">#1166370<\/a>. On Windows ATs, these dialogs were not reading the actual content of the dialog when announced, thus defeating their purpose. This was fixed by removing some workarounds in the MessageBoxView class, a reusable component found inside these dialogs which used to implement alert-like behavior. This confused some ATs, which saw an alert inside a dialog; now it&#8217;s the parent dialog who might behave like an alert if needed.<\/p>\n<p>Once this was fixed, we took also care of some speech duplication caused by several items having the same accessible name, reported as <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=1185092\">#1185092<\/a>.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-45.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-45-300x97.png\" alt=\"\" width=\"300\" height=\"97\" class=\"aligncenter size-medium wp-image-1078\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-45-300x97.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-45.png 461w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Save password and credit card dialogs<\/h3>\n<p>But browser interfaces themselves also use dialogs to create (hopefully) helpful interfaces for their users to do things like offering to save sensitive information like save a password or credit card information.  Sadly, neither the save password or credit card dialogs were announced (<a href=\"https:\/\/crbug.com\/1079320\">#1079320<\/a>, <a href=\"https:\/\/crbug.com\/1119367\">#1119367<\/a>, <a href=\"https:\/\/crbug.com\/1125118\">#1125118<\/a>). A previous attempt to enforce announcing &#8220;save password&#8221; (of which I talked in a previous post) caused it to be announced twice when using the toolbar icon to open it (<a href=\"https:\/\/crbug.com\/1132318\">#1132318<\/a>).<\/p>\n<p>These dialogs are particular because they have two behaviors: they can be explicitly opened using a toolbar icon, in which case they get focus immediately and must use the standard dialog role, or can be opened when a password is submitted.  In the latter case, they don&#8217;t get focus and so they need to be announced as alerts. We fixed the problem by making sure we use one or the other role depending on how they are triggered, which enforces the correct code paths to produce alert event only when necessary.<\/p>\n<p>Another useful things browsers offer to do is translate a page.  This problem also affected the translate page dialog (<a href=\"https:\/\/crbug.com\/1119734\">#1119734<\/a>). It shares code and behavior with the aforementioned ones and was fixed at the same time.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-42-54.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-42-54-224x300.png\" alt=\"\" width=\"224\" height=\"300\" class=\"aligncenter size-medium wp-image-1083\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-42-54-224x300.png 224w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-42-54.png 331w\" sizes=\"auto, (max-width: 224px) 100vw, 224px\" \/><\/a><\/p>\n<h3>Accounts and sync menu<\/h3>\n<p>Accounts and sync, the avatar icon in the toolbar, looks and behaves more similarly to a menu but it&#8217;s implemented with dialog (bubble) code. There were, unfortunately, some problems with it: it was not announced when opened (<a href=\"https:\/\/crbug.com\/1098304\">#1098304<\/a>) and contents that were informative and not focusable were not announced (<a href=\"https:\/\/crbug.com\/1078580\">#1078580<\/a> and <a href=\"https:\/\/crbug.com\/1161166\">#1161166<\/a>). We used a variety of techniques to fix the problem:<\/p>\n<ul>\n<li>The bubble already used a menu-like container role; so we enforce it to behave completely like a menu, using all the corresponding roles and emitting menu open\/close events.<\/li>\n<li>Use the informative, inaccessible titles as accessible names for containers, to make ATs announce them by context when focus jumps inside the container. Enforce certain role names for this to work on Windows.<\/li>\n<li>Make the top-most, inaccessible content (user name and email) part of the menu title for it to be announced by context when the menu\/dialog is opened.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-24.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-24.png\" alt=\"\" width=\"300\" height=\"554\" class=\"aligncenter size-full wp-image-1079\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-24.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-40-24-162x300.png 162w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Extension-related dialogs<\/h3>\n<p>Extension management also involves a lot of dialogs (install, manage, remove, confirmation).  We detected and fixed the issue <a href=\"https:\/\/crbug.com\/1123107\">#1123107<\/a>: the &#8220;add extension&#8221; dialog was not properly announced on Linux.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-01-26.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-01-26-300x132.png\" alt=\"\" width=\"300\" height=\"132\" class=\"aligncenter size-medium wp-image-1085\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-01-26-300x132.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-01-26.png 460w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>System dialogs<\/h3>\n<p>Browsers also launch system dialogs (open, save, print, etc). In the issue <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=1042864\">#1042864<\/a>, keystroke events were not being produced in these cases.. This was quite a complex one!  I wrote <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2020\/07\/27\/the-trip-of-a-key-press-event-in-chromium-accessibility\/\">two<\/a> <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2020\/10\/30\/event-management-in-x11-chromium\/\">posts<\/a> dedicated to just this problem and its solution.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-12-45-17.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-12-45-17-300x233.png\" alt=\"\" width=\"300\" height=\"233\" class=\"aligncenter size-medium wp-image-1087\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-12-45-17-300x233.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-12-45-17-387x300.png 387w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-12-45-17.png 718w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Restore after crash dialog<\/h3>\n<p>If your browser crashes, a dialog asking the user if they&#8217;d like to restore the tabs that were open before the crash is show.  This dialog was not being announced (<a href=\"https:\/\/crbug.com\/1023822\">#1023822<\/a>) and could not be focused with the Alt+Shift+A and F6 hotkeys (<a href=\"https:\/\/crbug.com\/1042010\">#1042010<\/a>). These were the first issues I worked on, and wrote a <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2020\/06\/08\/dialog-accessibility-in-chromium\/\">specific post<\/a> about them as well.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-38-01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-38-01-300x137.png\" alt=\"\" width=\"300\" height=\"137\" class=\"aligncenter size-medium wp-image-1081\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-38-01-300x137.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-10-38-01.png 338w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Site permission dialogs<\/h3>\n<p>Dialogs are also used in browsers to ask for their explicit permissions to access powerful features.  We briefly mentioned how these were fixed in a <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2020\/06\/08\/dialog-accessibility-in-chromium\/\">previous post<\/a> and we fixed their announcement (<a href=\"https:\/\/crbug.com\/1052675\">#1052675<\/a>) and their ability to be focused with hotkeys (<a href=\"https:\/\/crbug.com\/1052676\">#1052676<\/a>). In this process, I wrote the required code to emit alert events in the Linux accessibility backend, which was still missing at that point.<\/p>\n<p><a href=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-04-25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-04-25-300x122.png\" alt=\"\" width=\"300\" height=\"122\" class=\"aligncenter size-medium wp-image-1086\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-04-25-300x122.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2021\/04\/Screenshot-from-2021-04-08-11-04-25.png 375w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Additionally, I added more tests and cleaned up things a bit, refactoring code and removing some redundant events. It&#8217;s been quite a trip, building and testing on all the desktop platforms, taking into account platform-specific behavior and AT quirks&#8230; I still plan to keep working on this area, hardening automated testing if possible to prevent regressions, which should reduce the amount of effort in the long run.<\/p>\n<p>Thanks for reading, and happy hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a bit more than a year since I started working on Chromium accessibility. Although I&#8217;ve worked on several kinds of issues, a lot of them had to do with UI dialogs of some kind. Browser interfaces present many &hellip; <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2021\/04\/a-recap-of-chromium-dialog-accessibility-enhancements\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,23,24,3],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-accessibility","category-browsers","category-chromium","category-igalia"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":16,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1092,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1092"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}