Bugzilla – Bug 796
selfclosing elements not detected if not self closed
Last modified: 2010-12-02 03:44:44 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
(<code> tags in description are just for illustrative purposes, and aren't in the parced code)
(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.