[wp-trac] [WordPress Trac] #33001: Customizer loads wp-a11y.js multiple times
WordPress Trac
noreply at wordpress.org
Wed Jul 15 13:28:12 UTC 2015
#33001: Customizer loads wp-a11y.js multiple times
---------------------------------------+-------------------------
Reporter: afercia | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.3
Component: Customize | Version: 4.2
Severity: normal | Keywords: needs-patch
Focuses: accessibility, javascript |
---------------------------------------+-------------------------
Depending on the screen, the Customizer loads the `wp-a11y.js` script
multiple times, thus creating multiple live regions. Given the way screen
readers deal with live regions, which is very prone to inconsistencies, we
should avoid having multiple live regions.
As far as I see, to load faster the Customizer uses the "customize loader"
in 3 places:
- in the Dashboard and for a good reason, see [changeset:22089]
- in the themes.php screen
- in the update.php screen when updating a theme
in these screens, there will be 3 documents with 3 bodies so the live
regions will be appended to each body: the main body, the "customize
loader" iframe document body, and the Customizer preview iframe document
body.
In the other screens, just 2 times: in the main body and in the Customizer
preview iframe body.
Worth noting live regions are currently appended in the Dashboard, where
they're unnecessary.
(please consider in the first screenshot I've edited the DOM
representation in the console removing lots of stuff to make it shorter
and fit in the screenshot)
[[Image(https://cldup.com/MDwcEZ10VS.png)]]
[[Image(https://cldup.com/BYQxEDi8rj.png)]]
To my understanding this is not caused by the Customizer itself and it's
more related to the way `wp-a11y.js` is specified as dependency. Currently
it's a dependency of 'customize-base' and 'customize-nav-menus'. For the
other screens it's a dependency of 'theme' and 'updates'.
About the Customizer, maybe setting it as dependency at a later stage
(e.g. 'customize-controls') would fix this. Would like to hear the opinion
of someone more familiar with script dependencies than me though.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33001>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list