W3C home > Mailing lists > Public > public-webapps-bugzilla@w3.org > August 2012

[Bug 18672] New: [Templates]: Define the behavior of cloneNode(deep) on template elements

From: <bugzilla@jessica.w3.org>
Date: Fri, 24 Aug 2012 00:09:38 +0000
To: public-webapps-bugzilla@w3.org
Message-ID: <bug-18672-2532@http.www.w3.org/Bugs/Public/>

           Summary: [Templates]: Define the behavior of cloneNode(deep) on
                    template elements
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
        AssignedTo: dglazkov@chromium.org
        ReportedBy: rafaelw@chromium.org
         QAContact: public-webapps-bugzilla@w3.org
            Blocks: 15476

template == <template><div>Foo</div></template>

clone = template.cloneNode(true);

options for clone.content:

1) Empty document fragment; // new empty document fragment
2) template.content.cloneNode(deep);  // clone of contents
3) template.content; // share the original's content (content is a reference to
the same document fragment).

Given that one likely use of <template> is templating libraries, and one
motivator for supporting nested <template>s is nested iteration -- I'm
concerned that option (2) would be very wasteful of memory, but provide no
benefit for the use case (in fact many developers may not even think about the
behavior, and woudn't notice a difference between (2) & (3).

I'll put a stake in the ground and claim that the right behavior is (3) because
it makes the naive thing conservative WRT memory and isn't obviously bad
behavior. (2) can still be achieved with more work.

Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 24 August 2012 00:09:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:04:26 UTC