{"id":53,"date":"2020-08-20T14:42:14","date_gmt":"2020-08-20T14:42:14","guid":{"rendered":"https:\/\/html5accessibility.com\/stuff\/?p=53"},"modified":"2020-08-20T14:42:14","modified_gmt":"2020-08-20T14:42:14","slug":"hush-sweet-iframe","status":"publish","type":"post","link":"https:\/\/html5accessibility.com\/stuff\/2020\/08\/20\/hush-sweet-iframe\/","title":{"rendered":"Hush Sweet IFrame"},"content":{"rendered":"\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/assets.codepen.io\/128034\/blm.jpg\" alt=\"Black Lives Matter protest\" width=\"1000\" height=\"750\" \/>\r\n<figcaption>Black people cannot carry the weight of injustice on their shoulders, whilst the institutionalised systems still prevail (<a href=\"https:\/\/thetab.com\/uk\/sheffield\/2020\/06\/02\/dear-sheffield-students-this-is-how-you-can-support-black-lives-matter-44180\">source<\/a>)<\/figcaption>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>Back in 2010 I wrote some advice on how to hide iframe elements from screen reader users: <a href=\"https:\/\/developer.paciellogroup.com\/blog\/2010\/04\/making-sure-hidden-frames-are-hidden\/\">Making sure hidden frames are hidden<\/a><\/p>\r\n<p><strong>10 years on the advice is largely redundant.<\/strong><\/p>\r\n<h2><em>Some<\/em> background<\/h2>\r\n<p>HTML is an <a href=\"https:\/\/developer.paciellogroup.com\/blog\/2015\/10\/thus-spoke-html\/\">aural UI<\/a> for screen reader users. Sometimes announcing the element name, when a user navigates to the element, makes sense, other times it seems sort of clunky, jargonistic and even unnecessary (more noise than information). The majority of content is and has been <a href=\"https:\/\/developer.paciellogroup.com\/blog\/2016\/01\/the-state-of-hidden-content-support-in-2016\/\">robustly hidden<\/a> using standard methods, for years.<\/p>\r\n<p>Screen reader developers make the decisions about how and when the semantics of HTML will be conveyed to users (from what is available in the <a href=\"https:\/\/developer.paciellogroup.com\/blog\/2015\/01\/the-browser-accessibility-tree\/\">accessibility tree<\/a>), <em>hopefully<\/em> based on user feedback. For most elements there is a strong correlation between the element role and how it is identified to users (unless the role is explicitly overridden using the [<a href=\"https:\/\/www.w3.org\/TR\/wai-aria-1.1\/#roles_categorization\">ARIA <code>role<\/code><\/a>] attribute): <a href=\"https:\/\/freedomscientific.github.io\/VFO-standards-support\/html.html\">JAWS for example<\/a>.<\/p>\r\n<h2>How <code>iframe<\/code> elements and their content can be hidden from screen readers<\/h2>\r\n<p>Noting that depending on the platform and screen reader there are multiple ways to interact with content. For example, in JAWS, you can navigate to a <code>iframe<\/code> using the <kbd>tab<\/kbd> key (if the <code>iframe<\/code> content includes focusable content, or in Firefox the <code>iframe<\/code> itself is in the focus order) or using the <kbd>M<\/kbd> virtual navigation key or use the <kbd>arrow<\/kbd> keys to move through content (in <em>virtual<\/em> mode).<\/p>\r\n<p class=\"note\">Read <a href=\"https:\/\/tink.uk\/understanding-screen-reader-interaction-modes\/\">Understanding screen reader interaction modes<\/a> by <a href=\"https:\/\/twitter.com\/LeonieWatson\">L\u00e9onie Watson<\/a> for a detailed introduction to screen reader interaction modes.<\/p>\r\n<h2>Mostly Good Times<\/h2>\r\n<p>Nowadays unlike in the past all screen readers ignore <code>iframe<\/code>s and their content when they are hidden using the <code>hidden<\/code> attribute or <code>CSS display:none<\/code>, nothing more is needed. There does not appear to be a method to hide visually displayed <code>iframe<\/code>s from all screen readers. The following results are based on testing screen readers with these <a href=\"https:\/\/thepaciellogroup.github.io\/AT-browser-tests\/test-files\/iframe-hidden.html\">test cases<\/a><\/p>\r\n<table style=\"height: 792px;\" border=\"1\" width=\"580\"><caption>hiding iframes from selected screen readers<\/caption>\r\n<tbody>\r\n<tr>\r\n<th scope=\"col\">Screen reader (latest versions)<\/th>\r\n<th scope=\"col\">\u00a0<code>iframe<\/code>\u00a0 + <code>hidden<\/code><\/th>\r\n<th scope=\"col\"><code>iframe<\/code>\u00a0+ <code>display:none<\/code><\/th>\r\n<th scope=\"col\">\r\n<p><code>iframe<\/code>\u00a0 <code>aria-hidden=true<\/code> + <code>tabindex=-1<\/code>+ <code>role=none<\/code><\/p>\r\n<\/th>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">JAWS<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">NVDA<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">Narrator<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td><code>iframe<\/code> content announced and operable<\/td>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">VoiceOver Mac<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td><code>iframe<\/code> is in navigation order and announced as &#8220;application&#8221;, content of <code>iframe<\/code> is hidden.<\/td>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">VoiceOver iOS<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<\/tr>\r\n<tr>\r\n<th scope=\"row\">Talkback Android<\/th>\r\n<td>not announced<\/td>\r\n<td>not announced<\/td>\r\n<td>In Chrome if navigating by heading the heading in the iframe is announced. Not in Firefox.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p class=\"note\"><strong>Fun Fact 1<\/strong>: Use of the <code>title<\/code> attribute on an <code>iframe<\/code> does not result in display of a tooltip when the mouse cursor is over the <code>iframe<\/code>.<\/p>\r\n<p class=\"note\"><strong>Fun Fact 2<\/strong>: If you hide content using the <code>hidden<\/code> attribute or CSS <code>display:none<\/code> you don&#8217;t need <code>aria-hidden=\"true\"<\/code> as the state is already exposed in the browser accessibility tree!<\/p>","protected":false},"excerpt":{"rendered":"<p>Back in 2010 I wrote some advice on how to hide iframe elements from screen reader users: Making sure hidden frames are hidden 10 years on the advice is largely redundant. Some background HTML is an aural UI for screen reader users. Sometimes announcing the element name, when a user navigates to the element, makes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-htmlaccessibility"],"_links":{"self":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":33,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/53\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}