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

The generated HTML is not sematic #89

Open
tirithen opened this issue Nov 28, 2016 · 6 comments
Open

The generated HTML is not sematic #89

tirithen opened this issue Nov 28, 2016 · 6 comments

Comments

@tirithen
Copy link

When looking at the header for e.g. the paper-card component (https://elements.polymer-project.org/elements/paper-card) it does not use a h1 tag for the header. I would expect a section tag and a h1 in a card but all I can see are div tags. Is there a good reason for this or was it missed out on by accident?

@notwaldorf
Copy link
Contributor

I don't think the header would be visible in the shadow DOM, so its semantics would be missed anyway. It's only semantically meaningful in shady DOM -- we could change that, but I'm not sure it's worth it given that the end goal is a world where shadow DOM is enabled everywhere. WDYT?

@tirithen
Copy link
Author

tirithen commented Dec 6, 2016 via email

@notwaldorf
Copy link
Contributor

If SEO is a concern, you should distribute the content (much how like the contents of the card are distributed). Maybe the header shouldn't be an attribute, but a slot as well in that case.

@tirithen
Copy link
Author

tirithen commented Dec 7, 2016 via email

@notwaldorf
Copy link
Contributor

I entirely disagree that the paper elements were not written with SEO focus -- you are focusing on a very small bug, in the header of a card (where the rest of the content in the card is distributed, and therefore SEO parseable). You will notice that not many elements make this mistake, since most of them accept distributed content. Secondly, there is a very easy work around in the meantime, if this is an important issue to you -- you distribute a hidden header with the same content:

<paper-card heading="Card Title">
  <h1 hidden>Card Title</h1>
</paper-card>

Third, changing this inside the element itself shouldn't be very hard -- the div that displays the heading can take a slot, and if the slot is empty and the heading attribute is not, fallback to using the heading, so that it's still backwards compatible.

Please don't make generalizations about the entire "paper framework" based on one fairly small issue you've had with one element (which in all fairness nobody has raised in the year or so this element has been around), which is easily fixable.

@tirithen
Copy link
Author

tirithen commented Dec 8, 2016 via email

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

2 participants