[wp-trac] [WordPress Trac] #43496: CS: Fix disabled for user-edit.php

WordPress Trac noreply at wordpress.org
Tue Jan 15 00:10:55 UTC 2019


#43496: CS: Fix disabled for user-edit.php
--------------------------+-------------------------------
 Reporter:  mukesh27      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.1
Component:  Users         |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  coding-standards
--------------------------+-------------------------------

Comment (by GaryJ):

 Replying to [comment:10 pento]:
 > @GaryJ: Could you please clarify what your concern is here? The comment
 you linked to (and the w3c link) don't seem to apply to this.

 @pento

 My comment was in response to the notion that "using HTML5" would directly
 discourage the use of boolean attributes with values. It doesn't. One can
 still be valid HTML5, and use boolean attributes with values.

 Since the beginning, WordPress has tried to be valid HTML, but with
 seemingly a bit of leaning towards XHTML - think of the presence of self-
 closing / empty elements, like `<br />`, `<hr />` and `<img ... />`. The
 requirement of having a space before the closing slash is even in the core
 coding standards - and yet under non-XHTML HTML5, `<br>`, `<hr>` and `<img
 ...>` would be perfectly valid.

 Look at the mess of the source of https://wordpress.org to see how
 inconsistent the use of `/>` is in `link` and `meta` elements. Some of
 this will be from core, others from theme, but there's no community
 agreement formalising which it should be.

 The presence of the `xmlns="http://www.w3.org/1999/xhtml"` in the `html`
 tag is another thing that is only needed for XHTML.

 The `checked()`, `selected()`, `disabled()` and `readonly()` functions
 explicitly return the relevant attributes with values, which is only
 needed for XHTML.

 I've raised this inconsistency before. I'm not expecting wp-admin to be
 able to be served as `application/xhtml+xml` out of the box, but overall,
 it would be good for WordPress to decide if it's going to support any XML-
 serialized HTML features, or whether it can drop officially `/>`, the
 `xmlns` attribute`, boolean attributes with values, and other things like
 un-necessary quotes around certain attribute values, from its code and
 coding standards.

 The case FOR keeping the above, is to hold ourselves to a slightly
 stricter, but not XHTML, form of markup output, one that includes boolean
 attributes with values.

 Until that's decided, there will be an inevitable discussion about cases
 like this.

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


More information about the wp-trac mailing list