-
Notifications
You must be signed in to change notification settings - Fork 284
Title, headings and language in relation to iframes #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My interpretation (although I haven't looked into this for a while):
|
I've been given a very useful tip about this. If an iframe element has no accessible name (i.e. a title attribute) an AT user will be required to focus into the frame to discover what it is. That's a Headings and Labels violation, AFAICT. Similarly (I suppose) it would be necessary to provide lang on the iframe element in cases where the content loaded into it is in a language other than that of the parent page, so that users don't need to focus into the iframe to discover the language used there. (Language of Parts). If the content is in the same language as the parent page, it should (I suppose) be sufficient to put the lang attribute on the loaded child page, and omit it from the iframe element. There still needs to be a lang on the parent root/body, though. I'd be happy to be corrected about any of this, since they are not clearly stated in the current documentation, and are a mixture of deduction and unofficial advice. So there would be real benefits in making these rules of thumb explicit with some appropriate examples. |
FYI. The ACT rules only covers iFrames that are in the focus order (https://act-rules.github.io/rules/cae760) Strictly speaking there could be other situations where an iFrame would need a name as well - when it acts like a named region of visually distinct content - however, practically, most people flag all iFrames missing an accessible name. From the embedded standpoint - an iframe is considered part of a page. What is not covered as a web page is when a web page is embedded in something else like an Electron software app (from what I understand). |
I'd like to chime in on this point. If an iframe is part of the page, it should also obey the overall heading hierarchy of the main page. G141 Organizing a page using headings describes the proper nesting:
So, if I decide to embed a page as an iframe, it cannot have an h1 heading, right? It sounds a bit too harsh, unless I'm missing something. |
To my knowledge there is no prohibition of having multiple h1s on the page (with or without an iframe) if they correctly denote structure of the page. I agree for many iframes that it could be difficult to know the heading levels on the containing page. I the attempts at HTML outline were aimed at situations like this where there was syndicated content aggregated on pages and a loose heading structure was seen as desirable. |
Thanks for the clarification. As the document outline concept is no longer relevant, we are back to the plain heading levels. WHATWG is pretty clear about multiple h1s:
MDN documentation states it as follows:
Several accessibility experts advise against the usage of multiple h1-heading on one page (e.g. Accessible heading structure, The Truth about “The Truth About Multiple H1 Tags”). The WCAG does not clearly prohibit multiple h1s on one page though (at least not verbatim). So, it sounds like an iframe can have its own h1 in addition to the h1 in the main content. I still don't know how to go about the rest of the heading structure (iframe + main content, cf. G141 Organizing a page using headings), though... Your advice is still much appreciated! |
I would like to request some clarification about titles headings and language in relation to iframes
Please correct me if I am wrong, but as I understand the spec: Both the parent page and the child page should have
lang
attributes and<title>
elements, but thelang
attribute is not required on the iframe element itself. As this is not really mentioned or indicated anywhere, there is room for doubt, which wastes time. It's plausible to imagine that these features 'cascade down' into the iframe content by default."Understanding Headings and Labels" uses some opaque jargon 'For the purposes of conformance with these guidelines, a resource must be "non-embedded" within the scope of conformance to be considered a Web page.' - I am still not clear whether "non-embedded" includes iframe content or not, but I understand that the iframe itself needs a meaningful accessible name (most typically a
title
attribute).Sufficient Techniques or Failure examples would be an adequate and appropriate way to clarify this, since these are HTML-specific topics. The same example(s) could illustrate the relevant SCs in the 'Understanding...' docs about Page Titled, Language of Page, Headings and Labels and perhaps even Info and Relationships (although that SC already has dozens of examples).
The text was updated successfully, but these errors were encountered: