[wp-trac] [WordPress Trac] #37004: Html5 / W3C Validation

WordPress Trac noreply at wordpress.org
Thu May 18 07:36:55 UTC 2017


#37004: Html5 / W3C Validation
-------------------------------------------------+-------------------------
 Reporter:  arena                                |       Owner:  mihai2u
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  low                                  |   Milestone:  4.8
Component:  Administration                       |     Version:
 Severity:  trivial                              |  Resolution:
 Keywords:  good-first-bug has-screenshots has-  |     Focuses:
  patch                                          |  administration
-------------------------------------------------+-------------------------

Comment (by afercia):

 @mihai2u thanks for refreshing the patch! To clarify, the `colspan`
 attribute is a valid attribute in HTML5, see the spec:
 https://www.w3.org/TR/html5/tabular-data.html#the-td-element

 The quick edit and bulk edit forms work in a very special way. The forms
 are inside a table that is initially hidden and it's placed at the bottom
 of the page. This table works as sort of "placeholder" for the quick/bulk
 edit forms and it's made of two rows with just one column cell (`<td>`)
 with a colspan attribute. When activated, the table row containing the
 form fields gets injected at the top of the list table (bulk edit) or
 after the table row of a single post (quick edit).

 In the list tables, some columns can be optionally displayed or hidden:
 users can choose which columns to display from the Screen Options panel at
 the top of the page. That means there's no way to predict how many columns
 a table has.

 So, when the quick/bulk edit table row gets injected and become visible,
 it needs to know how many columns are currently set to be displayed in the
 table and update its colspan attribute accordingly, otherwise the layout
 will break.
 Note that users can also hide/display columns while the quick/bulk edit
 form is open, and when this happens, the JS needs to update on the fly the
 colspan attribute value.

 The validator message is actually different depending on the table you're
 validating and the initial value of the colspan attribute. Checking the
 post list table, for me is:
 `Table columns in range 2…7 established by element td have no cells
 beginning in them.`

 That doesn't mean the colspan attribute is not allowed. It just means the
 validator "sees" a table cell with `td colspan="7"` so that column is
 supposed to stretch across seven columns but that table doesn't contain
 other rows with 7 columns. It's the hidden table at the bottom of the page
 that works as "placeholder" for the quick/bulk edit rows.

 It's a bit complicated to explain. In a few words, I wouldn't be so
 worried because the "error" the validator sees is in a hidden table used
 just for printing out a template. It's not available to assistive
 technologies and doesn't break anything.

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


More information about the wp-trac mailing list