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

Problem extending "tr" with td contents in template #266

Closed
sorvell opened this issue Sep 3, 2013 · 7 comments
Closed

Problem extending "tr" with td contents in template #266

sorvell opened this issue Sep 3, 2013 · 7 comments
Assignees
Labels

Comments

@sorvell
Copy link
Contributor

sorvell commented Sep 3, 2013

The following was posted as a Custom Elements issue, but <polymer-element> should have the same problem:

Not high priority but I thought I'd pass this along. We had a bug report from trying to make a custom element that extends "tr". The problem is illustrated by this example:

<element name="x-game" extends="tr">      
<template>
  <td>{{game.id}}</td>
</template>

Unless the browser has native <template> it won't work because the TD is not allowed there. So this is only an issue with the polyfill. If you have native template, it should work as expected.

MDV has a similar problem and works around it by supporting the template attribute on table nodes. That lets you put templates in tables, but I can't see how that would help here. The best idea I can come up with is to build the DOM imperatively. Which might be okay if this problem doesn't happen frequently.

(Feel free to close if this outside the scope of custom elements! I couldn't quite figure the best place to report it. Original discussion is here:
https://groups.google.com/a/dartlang.org/forum/?fromgroups#!topic/web-ui/5bCCd_M0nps)

@ghost ghost assigned sorvell and ebidel Sep 25, 2013
@jmesserly
Copy link
Contributor

here's a pattern I think would work, with very minor changes to Polymer:

<polymer-element name="x-game" extends="tr">      
  <table><tr template>
    <td>{{game.id}}</td>
  </tr></table>
</polymer-element>

basically, create a bogus table structure to make HTML parsers happy.

Polymer could support this with a small change to templateContent() function. Instead of querySelector('template'), do querySelector for allTemplateSelectors

@jmesserly
Copy link
Contributor

if this approach sounds reasonable I could make a pull request :)

@sorvell
Copy link
Contributor Author

sorvell commented Nov 1, 2013

Sure, go for it. Thanks.

On Thu, Oct 31, 2013 at 5:54 PM, John Messerly notifications@github.comwrote:

if this approach sounds reasonable I could make a pull request :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/266#issuecomment-27541190
.

@sethladd
Copy link

sethladd commented Nov 1, 2013

/sub

@ebidel
Copy link
Contributor

ebidel commented May 15, 2014

@jmesserly did you ever get around to that patch?

@jmesserly jmesserly assigned jmesserly and unassigned sorvell Jun 11, 2014
@jmesserly
Copy link
Contributor

I didn't yet. But assigning to myself :)

@tjsavage
Copy link
Contributor

Closing this issue due to age and the release of version 1 release of Polymer - please feel free to re-open if this is incorrect.

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

No branches or pull requests

5 participants