Ticket #12076 (closed bug: patchwelcome)
In IE8 and below, time elements in cloned table elements have incorrect tag structures
| Reported by: | Ian Yang <ian.html@…> | Owned by: | rwaldron |
|---|---|---|---|
| Priority: | high | Milestone: | None |
| Component: | manipulation | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In IE8 and below, time elements in cloned table elements have incorrect tag structures like <:time>2012-07-12</:time>.
Change History
comment:1 Changed 10 months ago by rwaldron
- Owner set to rwaldron
- Priority changed from undecided to high
- Status changed from new to assigned
- Component changed from unfiled to manipulation
comment:2 Changed 10 months ago by rwaldron
- Priority changed from high to low
- Status changed from assigned to closed
- Resolution set to invalid
jQuery does not shim HTML5 elements, you MUST include html5shiv
comment:4 Changed 10 months ago by rwaldron
- Status changed from closed to reopened
- Resolution invalid deleted
Forgive me - it's late, I'm tired and I missed that. Re-opening.
comment:5 Changed 10 months ago by rwaldron
- Priority changed from low to high
- Status changed from reopened to assigned
comment:6 Changed 10 months ago by rwaldron
When I remove the table from the equation, it works fine, but whenever the unknown element is the child of the element being cloned, the whole system breaks down. I'll look at this further tomorow.
comment:8 Changed 8 months ago by rwaldron
- Status changed from assigned to closed
- Resolution set to patchwelcome
The only reasonable solution to solving this is to copy innerHTML from the source element into the clone element. Since we only want to do this when a non-native element (ie. HTML5 nodes are not native in oldIE) appears as a child of the element being cloned. To do this, we need to look at all of the children of the element being cloned and check if any have a nodeName that matches the known and supported HTML5 nodeNames. If any of those children have children themselves, then we need to traverse downward and run the same check on all of those children (and of course, so on down through all children). When the nest is only one or two branches deep, with a only a handful of children, this will work just fine. The problem comes when there are very deeply nested DOM trees with large children counts. In those cases, this approach becomes unrealistic.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
