Bug 137619 - Nested template contents are not cloned by document.importNode
Summary: Nested template contents are not cloned by document.importNode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL: http://jsfiddle.net/jakecigar/sxe7dzc...
Keywords:
Depends on: 137755
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-10 11:49 PDT by Jake
Modified: 2014-12-18 22:35 PST (History)
8 users (show)

See Also:


Attachments
Fixes the bug by sharing code with cloneNode (45.44 KB, patch)
2014-12-15 21:39 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes the bug by sharing code with cloneNode 2 (45.44 KB, patch)
2014-12-15 21:41 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jake 2014-10-10 11:49:19 PDT
Given a nested template…
<template id="select">
    <fieldset>
        <legend>{{name}}</legend>
        <select>
            <option>pick something!</option>
            <template id="option">
                <option value="{{value}}">{{text}}</option>
            </template>
        </select>
    </fieldset>
</template>

I can’t access the .content after the nested template has been duplicated with document.importNode.

http://jsfiddle.net/jakecigar/sxe7dzc4/3/

PS
It works in Chrome and firefox.
Comment 1 Jake 2014-10-15 15:16:26 PDT
Any ideas? Workarounds? Commiseration?
Comment 2 Alexey Proskuryakov 2014-10-16 00:17:09 PDT
See also: bug 137755.
Comment 3 Ryosuke Niwa 2014-12-14 00:00:29 PST
*** Bug 137755 has been marked as a duplicate of this bug. ***
Comment 4 Ryosuke Niwa 2014-12-15 21:39:58 PST
Created attachment 243346 [details]
Fixes the bug by sharing code with cloneNode
Comment 5 Ryosuke Niwa 2014-12-15 21:41:17 PST
Created attachment 243347 [details]
Fixes the bug by sharing code with cloneNode 2
Comment 6 Andreas Kling 2014-12-16 09:24:26 PST
Comment on attachment 243347 [details]
Fixes the bug by sharing code with cloneNode 2

r=me
Comment 7 WebKit Commit Bot 2014-12-16 11:08:14 PST
Comment on attachment 243347 [details]
Fixes the bug by sharing code with cloneNode 2

Clearing flags on attachment: 243347

Committed r177372: <http://trac.webkit.org/changeset/177372>
Comment 8 WebKit Commit Bot 2014-12-16 11:08:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Jake 2014-12-17 10:24:09 PST
Thanks so much for the fix! It works nicely in my real page.

Will this be in the next Safari for OS X and IOS?
Comment 10 Ryosuke Niwa 2014-12-18 22:35:07 PST
(In reply to comment #9)
> Thanks so much for the fix! It works nicely in my real page.
> 
> Will this be in the next Safari for OS X and IOS?

Apple does not comment on future product plans.