-
Notifications
You must be signed in to change notification settings - Fork 82
Update "iframe with interactive elements is not excluded from tab-order" rule to manage inert iframe elements #2038
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
Closed
giacomo-petri
wants to merge
26
commits into
act-rules:develop
from
giacomo-petri:giacomo-petri-iframe-with-interactive-element-patch
Closed
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b59bcd3
Update programmatically-determined-link-context.md
giacomo-petri b041d85
Merge branch 'act-rules:develop' into develop
giacomo-petri 63bd55f
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri 9c05f21
Update programmatically-determined-link-context.md
giacomo-petri 452504a
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri 349c1e3
Create modal-dialog
giacomo-petri eb95290
Rename modal-dialog to modal-dialog.md
giacomo-petri 149bca2
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri cc8411d
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri dc2ea72
Merge branch 'develop' into giacomo-petri-iframe-with-interactive-ele…
carlosapaduarte 8a20cc5
Merge branch 'develop' into giacomo-petri-iframe-with-interactive-ele…
carlosapaduarte b3ca4c8
Apply suggestions from code review
giacomo-petri 502f98b
Merge branch 'develop' into giacomo-petri-iframe-with-interactive-ele…
Jym77 f513178
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri ed2b5aa
Update and rename modal-dialog.md to inert.md
giacomo-petri a351297
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri aa22106
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri 40e33e2
Update spelling-ignore.yml
giacomo-petri 387b8df
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri 32c5648
Update inert.md
giacomo-petri f8fd582
Apply suggestions from code review
giacomo-petri 95b23ee
Update iframe-not-focusable-has-no-interactive-content-akn7bn.md
giacomo-petri 2aba16d
Update inert.md
giacomo-petri eefecee
Merge branch 'develop' into giacomo-petri-iframe-with-interactive-ele…
Jym77 076278e
Merge branch 'develop' into giacomo-petri-iframe-with-interactive-ele…
Jym77 3d655f4
Apply suggestions from code review
giacomo-petri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ acknowledgments: | |||||||
|
|
||||||||
| ## Applicability | ||||||||
|
|
||||||||
| This rule applies to any `iframe` element that [contains](#akn7bn:contain) at least one element for which all the following are true: | ||||||||
| This rule applies to any `iframe` element that is not [inert][] and that [contains](#akn7bn:contain) at least one element for which all the following are true: | ||||||||
|
|
||||||||
| - the element is [visible][]; and | ||||||||
| - the element is part of the [sequential focus navigation order][] of the `iframe`'s [document][]. | ||||||||
|
|
@@ -122,10 +122,61 @@ This `iframe` element contains a link that is not part of its [sequential focus | |||||||
| <iframe tabindex="-1" srcdoc="<a href='/' tabindex='-1'>Home</a>"></iframe> | ||||||||
| ``` | ||||||||
|
|
||||||||
| #### Inapplicable Example 5 | ||||||||
|
|
||||||||
| This `iframe` element is [inert][] because of its own `inert` [attribute value][]. | ||||||||
|
|
||||||||
| ```html | ||||||||
| <iframe inert srcdoc="<a href='/'>Home</a>"></iframe> | ||||||||
| ``` | ||||||||
|
|
||||||||
| #### Inapplicable Example 6 | ||||||||
|
|
||||||||
| Once "Privacy policy details" button is activated, the `iframe` element become [inert][] because of showModal() method that causes the `iframe` to be [blocked by a modal]. | ||||||||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Jym77 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
|
|
||||||||
| ```html | ||||||||
| <iframe srcdoc="<a href='/'>Home</a>"></iframe> | ||||||||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| <div> | ||||||||
| <button id="ppDetails">Privacy policy details</button> | ||||||||
| </div> | ||||||||
| <dialog id="ppDialog" aria-labelledby="dialogLabel"> | ||||||||
| <h2 id="dialogLabel">Privacy Policy</h2> | ||||||||
| <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | ||||||||
| <button id="cancel">Cancel</button> | ||||||||
| </dialog> | ||||||||
| <script> | ||||||||
| const ppDetails = document.getElementById("ppDetails"); | ||||||||
| const cancelButton = document.getElementById("cancel"); | ||||||||
| const dialog = document.getElementById("ppDialog"); | ||||||||
|
|
||||||||
| ppDetails.addEventListener("click", () => { | ||||||||
| dialog.showModal(); | ||||||||
| }); | ||||||||
|
|
||||||||
| cancelButton.addEventListener("click", () => { | ||||||||
| dialog.close(); | ||||||||
| }); | ||||||||
| </script> | ||||||||
| ``` | ||||||||
|
|
||||||||
| #### Inapplicable Example 7 | ||||||||
|
|
||||||||
| This `iframe` element is [inert][] because it is [blocked by a modal]. | ||||||||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Jym77 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
|
|
||||||||
| ```html | ||||||||
| <div style="width:100vw; height:100vh; position:absolute; left:0; top:0; background:#000; opacity: 0.8;"></div> | ||||||||
| <div role="dialog" aria-labelledby="modal-heading" aria-modal="true" tabindex="-1" style="width:calc(100% - 20vw); height:calc(100% - 20vh); margin-left:10vw; margin-top:10vh; position:absolute; left:0; top:0; background:#fff; z-index:1; padding:40px; box-sizing:border-box;"> | ||||||||
| <h2 id="modal-heading">Hello</h2> | ||||||||
| <p>Hello World!</p> | ||||||||
| </div> | ||||||||
| <iframe tabindex="-1" srcdoc="<a href='/'>Home</a>"></iframe> | ||||||||
| ``` | ||||||||
|
|
||||||||
| [attribute value]: #attribute-value 'Definition of Attribute Value' | ||||||||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| [container document]: https://html.spec.whatwg.org/#bc-container-document 'HTML browsing context container document, 2020/12/18' | ||||||||
| [document]: https://html.spec.whatwg.org/multipage/dom.html#document 'HTML definition of document' | ||||||||
| [flattened tabindex-ordered focus navigation scope]: https://html.spec.whatwg.org/multipage/interaction.html#flattened-tabindex-ordered-focus-navigation-scope 'HTML - Living Standard, 2022/07/08' | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks outdated? |
||||||||
| [inert]: #inert 'Definition of Inert' | ||||||||
| [nested browsing context]: https://html.spec.whatwg.org/#nested-browsing-context 'HTML nested browsing context, 2020/12/18' | ||||||||
| [owner document]: https://dom.spec.whatwg.org/#dom-node-ownerdocument 'DOM node owner document property, 2020/12/18' | ||||||||
| [sc211]: https://www.w3.org/TR/WCAG21/#keyboard 'WCAG 2.1 Success criterion 2.1.1 Keyboard' | ||||||||
|
|
||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| title: Inert | ||
| key: inert | ||
| unambiguous: true | ||
| objective: true | ||
| input_aspects: | ||
| - Accessibility tree | ||
| - CSS styling | ||
| - DOM tree | ||
| --- | ||
|
|
||
| An [HTML or SVG element][] is inert if: | ||
| - it has an `inert` [attribute value][] of true; or | ||
| - one of its ancestor elements has an `inert` [attribute value][] of true; or | ||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - it is [blocked by a modal](https://html.spec.whatwg.org/multipage/interaction.html#blocked-by-a-modal-dialog). | ||
giacomo-petri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.