Skip to content
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

No rendering of simple element (<x-element/>) without content tag #962

Closed
bdulac opened this issue Nov 24, 2014 · 2 comments
Closed

No rendering of simple element (<x-element/>) without content tag #962

bdulac opened this issue Nov 24, 2014 · 2 comments

Comments

@bdulac
Copy link

bdulac commented Nov 24, 2014

Really sorry to open another issue. I am a beginner with web components, so please forgive me if this is a misunderstanding...

I try to write a polymer component that doesn't need a content: only a single attribute.
It seems to me logical to write the template without a <content> tag: perhaps is this a misuse but it seems to work.
The rendering is fine with the <x-element></x-element> syntax.
But it does not work with the <x-element/> syntax.
Here is a gist of an HTML doc of my problem (the problematic case is in red) : https://gist.github.com/bdulac/5c39b740ec7a52a15e8b

@dhubler
Copy link

dhubler commented Nov 24, 2014

Unless I'm mistaken, this is really about requiring end tags.
Surprisingly, the HTML spec lists a finite set of html tags that don't
require end tags. If you're inventing tags thru polymer, requiring an end
tag is in compliance with HTML spec. Having said this, I learned this the
hard way as I'm sure many others will too. Maybe there's a way to detect
these and complain loudly v.s. silently failing. Until then, always add
end tags.

On Mon, Nov 24, 2014 at 2:52 PM, Bérenger Dulac notifications@github.com
wrote:

Really sorry to open another issue. I am a beginner with web components,
so please forgive me if this is a misunderstanding...

I try to write a polymer component that doesn't need a content: only a
single attribute.
It seems to me logical to write the template without a tag:
perhaps is this a misuse but it seems to work.
The rendering is fine with the syntax.
But it does not work with the syntax.
Here is a gist of an HTML doc of my problem (the problematic case is in
red) : https://gist.github.com/bdulac/5c39b740ec7a52a15e8b


Reply to this email directly or view it on GitHub
#962.

@ebidel
Copy link
Contributor

ebidel commented Nov 24, 2014

Custom elements are not allowed to be void elements (self-closing). This is part of the custom elements spec. Dupe of #899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants