<?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>14833</bug_id>
          
          <creation_ts>2011-11-15 14:02:37 +0000</creation_ts>
          <short_desc>&quot;If current node is a pre, textarea, or listing element, append a U+000A LINE FEED (LF) character.&quot; - no browser does this and when we tried it caused site-compat problems. It should either be removed or changed to only emit a extra LF if the element&apos;s fi</short_desc>
          <delta_ts>2013-03-27 13:09:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#serializing-html-fragments</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>roan.kattouw</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60045</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-11-15 14:02:37 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#serializing-html-fragments
Complete: http://www.whatwg.org/c#serializing-html-fragments

Comment:
&quot;If current node is a pre, textarea, or listing element, append a U+000A LINE
FEED (LF) character.&quot; - no browser does this and when we tried it caused
site-compat problems. It should either be removed or changed to only emit a
extra LF if the element&apos;s first child is a text node starting with a LF.

Posted from: 2001:4c28:a030:30:219:99ff:fe0e:5501
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111009 Firefox/10.0a1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61160</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-07 23:22:37 +0000</bug_when>
    <thetext>Well we definitely need something here, otherwise we&apos;ll get dataloss if there&apos;s a leading LF. But I can change it to be more conservative in when they are added, sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63381</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-01-31 00:39:18 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6940.
Check-in comment: Make HTML serialisation more conservative near &lt;pre&gt;.
http://html5.org/tools/web-apps-tracker?from=6939&amp;to=6940</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82680</commentid>
    <comment_count>3</comment_count>
    <who name="Roan Kattouw">roan.kattouw</who>
    <bug_when>2013-02-07 03:47:33 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Well we definitely need something here, otherwise we&apos;ll get dataloss if
&gt; there&apos;s a leading LF. But I can change it to be more conservative in when
&gt; they are added, sure.
Thanks! The data loss issue has been bothering me for a while, and I&apos;ve had to hack around it in some of my code. The console session in http://pastebin.com/64Jjs4NH demonstrates the insanity I&apos;m dealing with.

Sadly, comment 0 is right that no browser does this. Both Firefox and Chrome completely ignore this rule, causing data loss when parsing and reserializing &lt;pre&gt;s and &lt;textarea&gt;s whose contents start with a newline.

I hope browsers will actually fix this behavior in the future. I guess I&apos;ll have to tweak my hack such that it will work both for broken browsers and fixed ones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82682</commentid>
    <comment_count>4</comment_count>
    <who name="Roan Kattouw">roan.kattouw</who>
    <bug_when>2013-02-07 04:32:10 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I hope browsers will actually fix this behavior in the future.
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=838954 against Firefox and https://code.google.com/p/chromium/issues/detail?id=174829 against Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85055</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-03-27 13:09:33 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Sadly, comment 0 is right that no browser does this.

Opera has implemented and shipped the spec change here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>