[wp-trac] [WordPress Trac] #32600: wp.a11y.speak improvements

WordPress Trac noreply at wordpress.org
Sat Jun 13 12:36:54 UTC 2015


#32600: wp.a11y.speak improvements
----------------------------------+----------------------------------------
 Reporter:  afercia               |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  General               |     Version:  4.2
 Severity:  normal                |  Resolution:
 Keywords:  has-patch dev-        |     Focuses:  accessibility, javascript
  feedback                        |
----------------------------------+----------------------------------------

Comment (by jdgrimes):

 Replying to [comment:6 afercia]:
 > Refreshed patch uses a function to build the two live regions. Not sure
 about this though. Yes, the first version is a bit dumb but maybe cleaner
 IMHO.

 I prefer this second patch, because it will be easier to extend in the
 future if needed. But ultimately, either way works. :-)

 I do think that this part should be changed:

 {{{
  57                     // Populate the polite and assertive jQuery
 objects.
  58                     if ( 'assertive' === politeness ) {
  59                             $containerAssertive = $container;
  60                     } else {
  61                             $containerPolite = $container;
  62                     }
 }}}

 Rather than putting that in the `speakMarkup` function (maybe
 `addSpeakContainer` would be a better name?) I think the `$container`
 should just be returned by the function. Then instead of this:

 {{{
 87                      speakMarkup( 'wp-a11y-speak-polite', 'polite' );
 }}}

 You'd do this:

 {{{
 87                      $containerPolite = speakMarkup( 'wp-a11y-speak-
 polite', 'polite' );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32600#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list