This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16153 - [Templates]: Enable generated template elements to share a content docFrag
Summary: [Templates]: Enable generated template elements to share a content docFrag
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-28 20:27 UTC by Rafael Weinstein
Modified: 2015-08-04 09:26 UTC (History)
3 users (show)

See Also:


Attachments

Description Rafael Weinstein 2012-02-28 20:27:03 UTC
Clever templating use cases can optimize memory usage by sharing template content.

e.g.

<template iterate="foo">
  <span>{{ Person }}</span>
  <template iterate="stuffInPocket">
     <span>{{ whatsInPocket }}</span>
  </template>
</template>

---

The templating library is likely to stamp out multiple copies of 

  <span>{{ Person }}</span>
  <template iterate="stuffInPocket">
     <span>{{ whatsInPocket }}</span>
  </template>

maybe there's some way that each instance doesn't have to have a generated <template> element that contains exactly the same 
  
  <span>{{ whatsInPocket }}</span>

content docFrag

---

we could make content read-write, but then badness might occur if the content is assigned a docFrag owned by the outer document.
Comment 1 Hayato Ito 2015-07-06 07:18:17 UTC
Changing the category:
  From: WebAppsWG => Components Model
  To: WHATWG => HTML
Comment 2 Anne 2015-08-04 09:26:30 UTC
Seems this is old feedback about the original design, not against the current specification.