NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 796 - selfclosing elements not detected if not self closed
selfclosing elements not detected if not self closed
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: HTML5 schema
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-02 01:37 CET by Jonas
Modified: 2010-12-02 03:44 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas 2010-12-02 01:37:52 CET
if you didn't close a selfclosing element the validator doesn't trigger any warning/error

f.e.: if I have <code><input type="submit" value="Submit" ></code> in my file, the validator doesn't trigger a warning for the missing trailing slash (/)
according to the HTML5 rules an element without an end tag (i.e. a selfclosing element) must be closed with a space, followed by a / before the > (thus: " />" without quotes)

Best regards, Jonas
Comment 1 Jonas 2010-12-02 01:39:33 CET
(<code> tags in description are just for illustrative purposes, and aren't in the parced code)
Comment 2 Michael[tm] Smith 2010-12-02 03:44:44 CET
(In reply to comment #0)
> if you didn't close a selfclosing element the validator doesn't trigger any
> warning/error
> 
> f.e.: if I have <code><input type="submit" value="Submit" ></code> in my file,
> the validator doesn't trigger a warning for the missing trailing slash (/)
> according to the HTML5 rules an element without an end tag (i.e. a selfclosing
> element) must be closed with a space, followed by a / before the > (thus: " />"
> without quotes)

HTML5 does not actually require that. Take a look at the spec:

  http://dev.w3.org/html5/spec/syntax.html#start-tags

Check step 6:

"Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing."

...and note the word "may" there.

The U+002F "/" character is allowed on start tags for void elements, but it's not required. So the current validator behavior is correct, and there's nothing for us to change here.