[wp-trac] [WordPress Trac] #31749: submit_button() should not output empty name attribute

WordPress Trac noreply at wordpress.org
Tue Mar 24 14:49:36 UTC 2015


#31749: submit_button() should not output empty name attribute
-------------------------------+-----------------------------
 Reporter:  afercia            |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Administration     |    Version:  4.1
 Severity:  normal             |   Keywords:
  Focuses:  ui, accessibility  |
-------------------------------+-----------------------------
 Quickly discussed on Slack with @azaozz and the accessibility team, see
 https://wordpress.slack.com/archives/accessibility/p1426709000002222

 `submit_button()`, see also `get_submit_button()`, outputs an empty name
 attribute when an empty string is passed. This happens in several places
 in the admin, see for example in class WP_List_Table, where search_box()
 calls it this way:
 `submit_button( $text, 'button', '', false, array('id' => 'search-submit')
 );`

 According to the specs:
 http://www.w3.org/TR/html5/forms.html#naming-form-controls:-the-name-
 attribute
 4.10.19.1 Naming form controls: the name attribute
 The name content attribute gives the name of the form control, as used in
 form submission and in the form element's elements object. '''If the
 attribute is specified, its value must not be the empty string.'''

 Would recommend to fix this not just for the sake of formal compliance
 with the specs but also because seems is triggering a weird bug in
 ChromeVox, TL;DR, reported by our accessibility testers group:

 Michelle DeYoung
 Win8.1/Chrome/Chromevox
 When tabbing the user can tab to the action links in the Comments section
 and access them. I did notice that if ‘Quick Edit’ is selected the user is
 jumped out of the table and focus is taken to the Search box.

 Regardless of browsers and Assistive Technologies bugs, an empty name
 attribute it's pretty useless and seems it doesn't harm to remove it. See
 proposed patch and some screenshots for reference.

 [[Image(https://cldup.com/DE6TOk1hGg.png)]]

 [[Image(https://cldup.com/jJoUchUavs.png)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31749>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list