(2016-04-08, 08:49:45)shawn_a Wrote: Why does it matter pretty sure both are valid in html5
Hey, shawn_a thanks for your rapid reply. I wasn't expecting to hear from you so quickly, it is apparent that you work so hard. I would not have even noticed this issue if I had not been so impressed by your program that I wanted to try it out on my own personal site and developing my own bootstrap theme.
In response to your second post:
Yes, they will validate, however, from my experience sometimes there are problems like duplicate line-breaks and double horizontal rules in Opera and other older browsers.
The functional purpose of the HTML5 specifications is to provide developers of user-agents (Explorer, Chrome, Firefox, etc) direction and guidance in a common path for parsing the markup instuctions to deliver the correct audio-visual output intended by the author. User-agent developers interpret ambiguities in HTML and xhtml specifications and develope their parsing computations in differing ways. IExplorer is one result for example:
From the Innovation Theme header:
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" > <!--<![endif]-->
From the Web Hypertext Application Technology Working Group:
"Should I close empty elements with /> or >?
Void elements in HTML (e.g. the br, img and input elements) do not require a trailing slash. e.g. Instead of writing <br />, you only need to write <br>. This is the same as in HTML4. However, due to the widespread attempts to use XHTML1, there are a significant number of pages using the trailing slash. Because of this, the trailing slash syntax has been permitted on void elements in HTML in order to ease migration from XHTML1 back to HTML."
In short:
'In the head - base, link and meta are:
void elements in HTML5
but
in XHTML, these may use explicit closing tags as well as self-closing ones (just as non-void elements can).
In the body - Do not use an explicit closing tag for these void elements to avoid double-inclusion when shown in HTML (because of different parsing rules when the user-agent sees the trailing slash
and
in XHTML avoid self-closing tags on non-void elements which can sometimes accept content (such as <script>)).'
From W3C:
"Except for rules regarding parse errors, they are equivalent, since there is no appropriate end tag token in the fragment case, yet they involve far fewer state transitions. "
Simply put when the trailing slash is left on void-elements in HTML5 (<br-hr />) and foreign-elements (<meta-link />) more calculations are required by the user-agent and some calculations result in duplicate display i.e. a double-line break which looks like a paragraph break or a double horizontal rule instead of a single (has this never happened to you?). Multiply by instances X pages X sites X visitors.
How it affects me (and writers like me):
The CK Editor adds trailing slashes to void elements (I fixed mine i.a.w. your great wiki).
The GS Post/Page advenced meta info function adds trailing slashes to <meta name="description" ... />, <meta name="keywords ... /> and <link rel="canonical" ... /> (I haven't figured a fix yet)
I write most of my css and html markup freehand on a text editor. Brain-muscle memory remembers most of it and I automatically omit the trailing slashes if I am writing HTML5. When I proof the output source from the browser I am confronted with a mixture of < /> and < > that drives my O.C.D. crazy.
Ref:
https://wiki.whatwg.org/wiki/FAQ#The_WHATWG
https://www.w3.org/TR/html5/syntax.html
Thank You again for your powerful example of dedication. I'll help on this issue in any way I can. My strengths are in networks, hardware and HTML5 (growing). Just direct me, I'm retired but nonetheless as busy as you.
Shawn Mc aka chief