-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing tags with /> leads to ignored shadow DOM content #628
Comments
This is true before Polymer or ShadowDOM or any of these things come into being. |
According to this document, On Fri, Jul 11, 2014 at 4:23 PM, Scott J. Miles [email protected]
|
If you put some character to the left of '>' it's simply ignored by the HTML parser. E.g., '/>', '?>', '!>', are all the same. There are only a tiny handful of void elements ( All the rest including 100% of custom-elements must be closed with a proper end-tag. |
I'm aware of /> being an XHTML construct, yet the HTML5 parser supports it.
Will show 'Test me' just fine. What is the difference here? |
As I've said the HTML parser does not support Your example is bogus HTML, the only reason anything is displayed is because the parser has managed to soldier on anyway. What you have written is seen as:
which is ambiguous. |
Chrome does a great job to STILL parse it (you can see the content in the Debugger) and yet doesn't show it on the page. Very confusing. |
Sorry if I'm being pedantic, but for posterity, this has nothing to do with custom tags. You simply cannot use Many try to do this and to the degree it ever works, it's just luck that the parser was able to recover from the error. |
Agreed. The html5 spec is explicit about this: " If it is used for other elements, it is treated as a start tag Except for void tags (and foreign elements like svg), as Scott says, you On Fri, Jul 11, 2014 at 4:47 PM, Scott J. Miles [email protected]
|
Sjmiles, it had everything to do with me using a custom tag in the sample code. That's what I meant. |
See:
http://jsbin.com/cidozeda/1/
Note the unfortunate element.
Parses just fine, but leads to anything following that element be silently ignored!
if using the /> short-hand is not allowed, a warning in the console would be magnificent.
I spent hours chasing down this problem :)
The text was updated successfully, but these errors were encountered: