<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21017</bug_id>
          
          <creation_ts>2013-02-15 19:56:32 +0000</creation_ts>
          <short_desc>[Templates]: handle white space inside templates in a way that allows templates to be more human readable</short_desc>
          <delta_ts>2013-02-21 22:58:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>15476</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jacob Richman">jacobr</reporter>
          <assigned_to name="Rafael Weinstein">rafaelw</assigned_to>
          <cc>jmesserly</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83208</commentid>
    <comment_count>0</comment_count>
    <who name="Jacob Richman">jacobr</who>
    <bug_when>2013-02-15 19:56:32 +0000</bug_when>
    <thetext>Most existing html template systems such as Mustache and Closure Templates strip some white space from templates.
This makes it easier for users to write templates in a way that us human readable. The issue is acute once templates support syntax for expressing conditionals. At that point, it is common for templates to have 400 characters of template code generate a single line of output.

For example, consider the following &lt;templates&gt; we wrote using experimental syntax to enable loops and conditionals.
https://github.com/dart-lang/dart-api-app/blob/c65256f1ac4ea680f145355c3ae204fe195b3e43/client/web/doc_link.html

These templates all need to avoid accidental white space so we end up with unreadable ~400 character lines.

-Jacob</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83209</commentid>
    <comment_count>1</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2013-02-15 20:06:48 +0000</bug_when>
    <thetext>This is an interesting issue, but it&apos;s outside the scope of the goals for the current template element which is solely a mechanism for defining a prototype of dom fragments.

It seems to me that a scripting mechanism using the template element has sufficient semantics to implement whatever policy it chooses for dealing with whitespace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83514</commentid>
    <comment_count>2</comment_count>
    <who name="John Messerly">jmesserly</who>
    <bug_when>2013-02-21 22:58:43 +0000</bug_when>
    <thetext>Hey Rafael,

We were also seeing this problem with web components:

&lt;element name=&quot;...&quot;&gt;
  &lt;template&gt;
    ... contents ...
  &lt;/template&gt;
&lt;/element&gt;


What&apos;s the best way to deal with it in this case?
We end up with extra whitespace text nodes.

Maybe we can deal with this when we instantiate the shadow root?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>