-
Notifications
You must be signed in to change notification settings - Fork 159
Editorial: ARIA Notify security prose, intro, and i18n example #2869
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
base: main
Are you sure you want to change the base?
Changes from all commits
f886cb1
dfbf6f2
48a3941
c742afb
793ef9d
22a4e38
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 |
|---|---|---|
|
|
@@ -16856,6 +16856,9 @@ <h2>Interface Mixin <dfn>ARIAMixin</dfn></h2> | |
| </section> | ||
| <section id="ARIANotifyMixin" class="normative" data-dfn-for="ARIANotifyMixin" data-link-for="ARIANotifyMixin"> | ||
| <h2>Interface Mixin <dfn>ARIANotifyMixin</dfn></h2> | ||
| <p> | ||
| The ariaNotify API allows authors to provide notifications for accessibility. The <code>ariaNotify</code> method accepts a string as a first parameter and a configuration object as a second (optional) parameter. | ||
| </p> | ||
| <pre class="idl" data-cite="webidl"> | ||
| enum AriaNotifyPriority { "normal", "high" }; | ||
|
|
||
|
|
@@ -16868,7 +16871,26 @@ <h2>Interface Mixin <dfn>ARIANotifyMixin</dfn></h2> | |
| Element includes ARIANotifyMixin; | ||
| Document includes ARIANotifyMixin; | ||
| </pre> | ||
|
|
||
| <p>Since ariaNotify does not have a parameter to specify the language of the notification, the notification inherits that of its containing element</p> | ||
| <p>For cases where the language of the notification differs from that of its containing element, authors can use a separate container element and add language markup to convey the language.</p> | ||
| <aside class="example"> | ||
| <p> | ||
| The original page language is English, but there is a notification in Spanish. | ||
| </p> | ||
| <!-- ReSpec needs these examples to be unindented. --> | ||
|
Contributor
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. But they are indented. |
||
| <pre class="example highlight html"> | ||
|
Contributor
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 example could be more terse, and might be easier to read if there is a generated element. Something like: // To create a one-off notification that doesn't match the
// language of the page or any other existing element, authors
// could append a dynamically created courier element.
var courier = document.createElement('div')
courier.setAttribute('lang', 'es');
document.body.appendElement(courier);
courier.ariaNotify('Este texto deberΓa leerse con la voz en espaΓ±ol'); Note: I did not test the syntax above. Please verify if you decide to use this.
Contributor
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. For clarity, this is a suggestion, but the longer existing example is fine if the WG prefers. (I have no objection to disregarding my suggestion here.)
Contributor
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. it would be |
||
| <p>Text in English, the original language of the page.</p> | ||
| <span class="spanish-notification" lang="es"></span> | ||
| <button class="spanish-notification-trigger">Spanish notification trigger</button> | ||
| <script> | ||
| document.ariaNotify('some text string that inherits the English language defined on the html element'); | ||
| const spanishElement = document.querySelector('.spanish-notification'); | ||
| const spanishElementTrigger = document.querySelector('.spanish-notification-trigger'); | ||
| spanishElementTrigger.addEventListener('click', () => { | ||
| spanishElement.ariaNotify('Este texto deberΓa leerse con la voz en espaΓ±ol'); | ||
| }); | ||
| </script> | ||
| </aside> | ||
| <p> | ||
| The User Agent processing steps for the | ||
| <code><dfn data-df-type="method" data-dfn-for="ARIANotifyMixin">ariaNotify</dfn>(<var>announcement</var>, <var>options</var>)</code> | ||
|
|
@@ -17258,7 +17280,11 @@ <h2>Example IDL Attribute Usage</h2> | |
| </section> | ||
| <section class="informative" id="security-considerations"> | ||
| <h2>Security Considerations</h2> | ||
| <p>This specification introduces no new security considerations.</p> | ||
| <p> | ||
| The <a>"aria-notify"</a> permissions policy has a default allowlistΒ ofΒ "*". This relaxes the Permission Policy default because requiring embedders to opt in for each frame would leave announcements coming | ||
|
Contributor
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 don't recall why this decision was made... Is it worth an editorial note pointing to prior discussions, or explaining why? I've never seen Live Regions abused in an ad frame, so maybe that's the reason? If theres a direct link to tjhis detail in the explainer or discussion, should it be listed or linked here? |
||
| from third-party content inaccessible by default. Cross-origin embedded content can invoke this user-facing channel without explicit delegation, which can cause uncontrolled disruption for uses of assistive technologies. Authors who want tighter control can still restrict theΒ "aria-notify"Β policy explicitly, for example with | ||
|
Contributor
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. And there is is nothing stopping implementations from restricting this for untrusted sources, right? If not, we could mention that as a "UAs SHOULD/MAY" in the spec. |
||
| <code><iframe allow="aria-notify 'none'"></code> or <code>Permissions-Policy: aria-notify=(self)</code>. | ||
|
Contributor
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 might be seen as prioritizing author ease over AT users re: Priorities of Constituencies?
Contributor
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. Though that's not really a Security risk... It's more just a "user annoyance" pester risk.
Contributor
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. But if ariaNotify is mentioned in this context, should Live Regions be mentioned, too? |
||
| </p> | ||
| </section> | ||
| <section class="informative" id="privacy-considerations"> | ||
| <h2>Privacy Considerations</h2> | ||
|
|
||
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.
nit: this isn't really a containing/container element, I think. It seems more appropriate to call it the source element or the calling element, since
ariaNotifyis a method and not a child or descendant.