Iframes allow to include any external content into a page. As such, precaution must be taken that external content does not mess up the semantics of the surrounding content with improper heading levels and hierarchies.
In general, screen readers treat content in an iframe like any other content on the page.
In addition, they announce the frame:
NVDA simply announces "frame".
JAWS also announces the iframe's title attribute, so be sure to always provide a meaningful title to an iframe.
Also, both NVDA and JAWS allow navigating directly to any frame using the m key.
<h1>
My Hobbies
</h1><p>
These all are activities I love to do on a regular basis.
</p><h2>
Playing Soccer
</h2><p>
Soccer is a team sport played between two teams of eleven players with a spherical ball.
</p><h2>
Dancing
</h2><iframesrc="iframe.html"title="Additional info about dancing"></iframe><h3>
Gardening
</h3><p>
Gardening is the practice of growing and cultivating plants as part of horticulture.
</p>
Category
Result
Comments
Date
Keyboard only
✔ (pass) pass
-
2018-5-14
NVDA 2018.1 + FF Quantum 59.0.2
✔ (pass) pass
-
2018-5-8
JAWS 2018.3 + IE 11
✔ (pass) pass
-
2018-6-15
JAWS 2018.3 + FF ESR 52.7.3
✔ (pass) pass
-
2018-5-7
Headings in iframes
Screen readers integrate headings from iframes directly into the heading outline of the parent page. This means that you have to be very careful that an embedded content's heading does not badly affect your embedding page's heading outline.
The following bad example illustrates what can happen: the embedded content is meant to be part of the heading on level 2 "Dancing", but it defines its own headings on level 1.
<h1>
My Hobbies
</h1><p>
These all are activities I love to do on a regular basis.
</p><h2>
Playing Soccer
</h2><p>
Soccer is a team sport played between two teams of eleven players with a spherical ball.
</p><h2>
Dancing
</h2><iframesrc="iframe.html"title="Additional info about dancing"></iframe><h3>
Gardening
</h3><p>
Gardening is the practice of growing and cultivating plants as part of horticulture.
</p>
The resulting headings outline looks like this to a screen reader:
<h1> Hobbies
<h2> Playing Soccer
<h2> Dancing
<h1> Salsa
<h1> Rock'n'Roll
<h2> Gardening
To fix it, the headings in the embedded content need to be on the correct level relatively to the parent page.
<h1>
My Hobbies
</h1><p>
These all are activities I love to do on a regular basis.
</p><h2>
Playing Soccer
</h2><p>
Soccer is a team sport played between two teams of eleven players with a spherical ball.
</p><h2>
Dancing
</h2><iframesrc="iframe.html"title="Additional info about dancing"></iframe><h3>
Gardening
</h3><p>
Gardening is the practice of growing and cultivating plants as part of horticulture.
</p>