Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#33312 closed defect (bug) (wontfix)

WP a11y speak and iframes: doubled live regions

Reported by: afercia's profile afercia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: General Keywords: has-patch
Focuses: accessibility, javascript Cc:

Description

Whenever there is an iframe and the wp-a11y script is enqueued, the polite and assertive live regions get appended twice, the first time in the main body and the second time in the iframe's body. For example, this happens when the Plugin details modal opens, see screenshot below.
This should be definitely avoided, also because sometimes screen readers announce "alert" when the modal dialog's iframe loads. Live regions should be appended only to the top level body.

https://cldup.com/dhjbPol34X.png

Attachments (1)

33312.patch (475 bytes) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (7)

@afercia
9 years ago

#1 @afercia
9 years ago

  • Keywords has-patch added

The proposed patch introduces a check for window.frameElement, not sure it's the best method to use here, feedback and suggestions welcome.

#2 @ocean90
9 years ago

How would this work if the iframe is actively using the regions?

#3 follow-up: @azaozz
9 years ago

This happens because the wp-a11y.js is loaded in both: the iframe and the main window.

This is the right way for that functionality to work. Keep in mind that iframes are pretty much same as separate windows/tabs, i.e. scripts from the main window do not run inside an iframe unless specifically designed to do so and meeting the "same origin" requirement.

If we don't need the "speak" functionality inside the iframe, we should stop loading the script there.

Last edited 9 years ago by azaozz (previous) (diff)

#4 in reply to: ↑ 3 @afercia
8 years ago

Replying to azaozz:

If we don't need the "speak" functionality inside the iframe, we should stop loading the script there.

Yup it would be nice to don't load it in the first place, in this case it's a dependency of updates.js which is loaded both in the main document and in the iframe. Not sure what to do here.

This ticket was mentioned in Slack in #accessibility by rianrietveld. View the logs.


8 years ago

#6 @afercia
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Going to close. Seems having the script loaded twice doesn't harm anything, the real problem is about NVDA announcing "alert" and there's a ticket for that: #36289

Note: See TracTickets for help on using tickets.