Re: [w3c/webcomponents] Custom 'void' or self-closing elements (HTML parser changes) (#624)

This may not matter, since it's browser vendors that need convincing, but it really makes no sense not to allow any tag to self close. Its semantically and unambiguously equivalent to spelling out the whole close tag.

Arguments about ergonomics or "writing big apps" aside (they don't convince me, that's just wishy washy), the real reason in my opinion for self closing tags is they communicate intent better than not having them. When making a custom component for which nested content will never make sense, it's a bad idea to have markup that kind of sort of implies that it might do something. It's just another place for errors. A self closing tag means "the child content of this element is meaningless, and should even be considered an error". You need look no further than the humble meta tag. Why would the interface want to *imply* that it might mean something to write <meta>hello</meta>? I suppose component authors can do runtime checks to validate things like that. 

On the other hand, to me it doesn't matter that much either way. It just seems like such a trivially silly thing to have in the html5 spec.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/624#issuecomment-501925365

Received on Friday, 14 June 2019 00:30:00 UTC