-
Notifications
You must be signed in to change notification settings - Fork 70
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
Update "iframe with interactive elements is not excluded from tab-order" rule to manage inert iframe elements #2038
Changes from 10 commits
b59bcd3
b041d85
63bd55f
9c05f21
452504a
349c1e3
eb95290
149bca2
cc8411d
dc2ea72
8a20cc5
b3ca4c8
502f98b
f513178
ed2b5aa
a351297
aa22106
40e33e2
387b8df
32c5648
f8fd582
95b23ee
2aba16d
eefecee
076278e
3d655f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,13 +28,17 @@ 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](#akn7bn: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][]. | ||||||||||
|
||||||||||
An element is <dfn id="akn7bn:contain">contained</dfn> in a [nested browsing context][] if its [owner document][] is the [container document][] of the [nested browsing context][]. | ||||||||||
|
||||||||||
An `iframe` element is <dfn id="akn7bn:inert">inert</dfn> if: | ||||||||||
- it has an `inert` [attribute value][] of true; or | ||||||||||
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. The attribute value doesn't matter. It just has to be present. Plus this should apply to ancestors too. Inert disables the entire subtree. 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.
As per our definition of attribute value, boolean attribute (like
giacomo-petri marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
- an element which is not the iframe itself and that is not [contained](#akn7bn:contain) in it behaves as a [modal][], making the iframe inoperable. | ||||||||||
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. What does "behaves as a modal" mean? 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. 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. I think we can probably refer directly to the HTML definition of inert. If we want to have our own definition of inert, we should probably refer to "being blocked by a modal", since it is objective and unambiguous, and a common definition from higher spec. 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
Does that improve the situation at all? 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. What I meant by modal dialogs was the actual
I'm not sure we should try for a generic modal definition. I don't know how you'd do that in a way that's objective. 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. Then, we are indeed going for blocked by a modal:
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
|
||||||||||
|
||||||||||
## Expectation | ||||||||||
|
||||||||||
The test target does not have a negative number as a `tabindex` [attribute value][]. | ||||||||||
|
@@ -122,10 +126,32 @@ 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> | ||||||||||
giacomo-petri marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
``` | ||||||||||
|
||||||||||
#### Inapplicable Example 6 | ||||||||||
|
||||||||||
This `iframe` element is [inert][] because of another element that behaves as a [modal][]. | ||||||||||
|
||||||||||
```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.
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' | ||||||||||
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
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? |
||||||||||
[modal]: #modal-dialog 'Definition of Modal dialog' | ||||||||||
[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' | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Modal dialog | ||
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. I'm concerned this could be confused by the |
||
key: modal-dialog | ||
unambiguous: true | ||
objective: true | ||
input_aspects: | ||
- Accessibility tree | ||
- CSS styling | ||
- DOM tree | ||
--- | ||
|
||
A modal dialog is a type of user interface element that appears on top of the main content of a [html web page][] or application and requires the user to take some action or make a decision before they can continue interacting with the program. | ||
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. I don't think "type of user interface" is objective. I think this needs to focus on the element preventing interaction with all other elements that are not their children. This definition really needs to be objective, because it is used in the applicability of the rule.
giacomo-petri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Modal dialogs are typically used to display important messages, prompts, or alerts that require the user's attention and prevent them from interacting with other parts of the page until they have addressed the issue at hand. They are "modal" because they create a temporary mode where the user is focused on the dialog and cannot interact with the rest of the page. | ||
|
||
[html web page]: #web-page-html 'Definition of Web Page' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can have this as a definition also, to make it reusable in other (future?) rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And probably it would be better to have a definite of inert element, not just inert iframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should have a separate definition of "inert element".