{"id":1349,"date":"2018-04-27T14:31:07","date_gmt":"2018-04-27T14:31:07","guid":{"rendered":"http:\/\/pressbooks.library.ryerson.ca\/pwaa\/?post_type=chapter&#038;p=1349"},"modified":"2019-08-12T16:15:39","modified_gmt":"2019-08-12T16:15:39","slug":"code-examination-and-repair","status":"publish","type":"chapter","link":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/chapter\/code-examination-and-repair\/","title":{"raw":"Code Examination and Repair","rendered":"Code Examination and Repair"},"content":{"raw":"<div style=\"margin: 1em 0;padding: 1em;border: 1px solid #ddd;border-left: 10px solid #0be\"><strong>Technical:<\/strong> The content on this page is intended for a technical audience.<\/div>\r\n<div>\r\n<div style=\"margin: 1em 0;padding: 1em;border: 1px solid #ddd;border-left: 10px solid #3c3\"><strong>Toolkit:<\/strong> If your preferred browser is Firefox, you may wish to install\u00a0<strong><a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/developer\/\" target=\"_blank\" rel=\"noopener noreferrer\">Firefox for Developers<\/a><\/strong>, with extended developer tools. You can also use the standard <strong>Inspect Element<\/strong> tool found in most browsers\u2019 context menu by right clicking on an element and selecting it from the menu.<\/div>\r\nOnce you have discovered a potential barrier, you can identify where the problem is occurring in the HTML markup. In the screenshot below, the feedback tab (1) on the right of the screen is examined by right clicking and choosing \u201cInspect Element with Firebug\"\u201d (2). <strong>Note:<\/strong> Firebug is now deprecated, but you can do the same thing with selecting \u201cInspect Element\u201d from the menu. You will notice the code associated with the feature is highlighted in the code window (3) to the lower left. Click on the Edit button (4) to edit that HTML to test possible solutions.\r\n\r\n<img src=\"https:\/\/pressbooks.library.ryerson.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1.png\" alt=\"screen shot showing code examination, described above\" class=\"alignnone size-full wp-image-90\" width=\"626\" height=\"337\" \/>\r\n\r\n<strong>Figure: Steps to examine and modify code to test potential accessibility solutions<\/strong>\r\n\r\nIn the case above, the Tab Key Navigation test revealed that the Feedback tab would not receive focus, thus could not be operated with a keyboard. A simple fix for this is to add <code>tabindex=\"0\"<\/code> to the main element containing the tab. Once added, without reloading the page, the Tab Key Navigation test is conducted again to see if the tab now takes keyboard focus. It does, though it is still not possible to operate the tab, which requires modifying the associated JavaScript.\r\n\r\n<img src=\"https:\/\/pressbooks.library.ryerson.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix.png\" alt=\"firebug code edit window, described in the caption below\" class=\"alignnone size-full wp-image-44\" width=\"502\" height=\"176\" \/>\r\n\r\n<strong>Figure: Result of adding <code>tabindex=\"0\"<\/code><\/strong>\r\n\r\nAfter clicking the Edit button, the selected code from above is opened for editing. In this case <code>tabindex=\"0\"<\/code> has been added to test whether this adds keyboard focus to the Feedback tab (which it does).\r\n\r\nFor a look at other tools for examining code, watch the following video on the Chrome accessibility audits.\r\n\r\n<strong>Video:\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=b0Q5Zp_yKaU\" target=\"_blank\" rel=\"noopener noreferrer\">The new way to test accessibility with Chrome DevTools<\/a><\/strong>\r\n\r\n[embed]https:\/\/www.youtube.com\/embed\/b0Q5Zp_yKaU[\/embed]\r\n\r\n<\/div>\r\n<span class=\"small\">\u00a9 Google Chrome Developers. Released under the terms of a Creative Commons Attribution license.<\/span>","rendered":"<div style=\"margin: 1em 0;padding: 1em;border: 1px solid #ddd;border-left: 10px solid #0be\"><strong>Technical:<\/strong> The content on this page is intended for a technical audience.<\/div>\n<div>\n<div style=\"margin: 1em 0;padding: 1em;border: 1px solid #ddd;border-left: 10px solid #3c3\"><strong>Toolkit:<\/strong> If your preferred browser is Firefox, you may wish to install\u00a0<strong><a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/developer\/\" target=\"_blank\" rel=\"noopener noreferrer\">Firefox for Developers<\/a><\/strong>, with extended developer tools. You can also use the standard <strong>Inspect Element<\/strong> tool found in most browsers\u2019 context menu by right clicking on an element and selecting it from the menu.<\/div>\n<p>Once you have discovered a potential barrier, you can identify where the problem is occurring in the HTML markup. In the screenshot below, the feedback tab (1) on the right of the screen is examined by right clicking and choosing \u201cInspect Element with Firebug&#8221;\u201d (2). <strong>Note:<\/strong> Firebug is now deprecated, but you can do the same thing with selecting \u201cInspect Element\u201d from the menu. You will notice the code associated with the feature is highlighted in the code window (3) to the lower left. Click on the Edit button (4) to edit that HTML to test possible solutions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.library.ryerson.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1.png\" alt=\"screen shot showing code examination, described above\" class=\"alignnone size-full wp-image-90\" width=\"626\" height=\"337\" srcset=\"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1.png 626w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1-300x162.png 300w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1-65x35.png 65w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1-225x121.png 225w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_code-1-350x188.png 350w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/p>\n<p><strong>Figure: Steps to examine and modify code to test potential accessibility solutions<\/strong><\/p>\n<p>In the case above, the Tab Key Navigation test revealed that the Feedback tab would not receive focus, thus could not be operated with a keyboard. A simple fix for this is to add <code>tabindex=\"0\"<\/code> to the main element containing the tab. Once added, without reloading the page, the Tab Key Navigation test is conducted again to see if the tab now takes keyboard focus. It does, though it is still not possible to operate the tab, which requires modifying the associated JavaScript.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.library.ryerson.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix.png\" alt=\"firebug code edit window, described in the caption below\" class=\"alignnone size-full wp-image-44\" width=\"502\" height=\"176\" srcset=\"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix.png 502w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix-300x105.png 300w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix-65x23.png 65w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix-225x79.png 225w, https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-content\/uploads\/sites\/30\/2018\/01\/examine_fix-350x123.png 350w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/p>\n<p><strong>Figure: Result of adding <code>tabindex=\"0\"<\/code><\/strong><\/p>\n<p>After clicking the Edit button, the selected code from above is opened for editing. In this case <code>tabindex=\"0\"<\/code> has been added to test whether this adds keyboard focus to the Feedback tab (which it does).<\/p>\n<p>For a look at other tools for examining code, watch the following video on the Chrome accessibility audits.<\/p>\n<p><strong>Video:\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=b0Q5Zp_yKaU\" target=\"_blank\" rel=\"noopener noreferrer\">The new way to test accessibility with Chrome DevTools<\/a><\/strong><\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-1\" title=\"The new way to test accessibility with Chrome DevTools - A11ycasts #23\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/b0Q5Zp_yKaU?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<\/div>\n<p><span class=\"small\">\u00a9 Google Chrome Developers. Released under the terms of a Creative Commons Attribution license.<\/span><\/p>\n","protected":false},"author":56,"menu_order":5,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-1349","chapter","type-chapter","status-publish","hentry"],"part":1337,"_links":{"self":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapters\/1349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/wp\/v2\/users\/56"}],"version-history":[{"count":6,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapters\/1349\/revisions"}],"predecessor-version":[{"id":2260,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapters\/1349\/revisions\/2260"}],"part":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/parts\/1337"}],"metadata":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapters\/1349\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/wp\/v2\/media?parent=1349"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/pressbooks\/v2\/chapter-type?post=1349"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/wp\/v2\/contributor?post=1349"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/pwaa\/wp-json\/wp\/v2\/license?post=1349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}