<?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>15002</bug_id>
          
          <creation_ts>2011-11-30 13:03:20 +0000</creation_ts>
          <short_desc>Clarify status of initial newline in &lt;pre&gt; and &lt;textarea&gt;</short_desc>
          <delta_ts>2011-12-02 14:38:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry S. Thompson">ht</reporter>
          <assigned_to name="Eliot Graff">eliotgra</assigned_to>
          <cc>eliotgra</cc>
    
    <cc>hsivonen</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60662</commentid>
    <comment_count>0</comment_count>
    <who name="Henry S. Thompson">ht</who>
    <bug_when>2011-11-30 13:03:20 +0000</bug_when>
    <thetext>In the Newlines in textarea and pre Elements section, please add something clarifying that in order to begin the content of one of these elements with a newline, a character reference, e.g. &amp;#10;, should be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60717</commentid>
    <comment_count>1</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-12-01 06:24:15 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; In the Newlines in textarea and pre Elements section, please add something
&gt; clarifying that in order to begin the content of one of these elements with a
&gt; newline, a character reference, e.g. &amp;#10;, should be used.

A character reference is no different from a literal line feed character in this case. The character reference is expanded on the tokenizer level but the line feed is dropped on the tree builder level. The tree builder doesn&apos;t know if the character originated from a character reference, so &amp;#10; immediately after &lt;pre&gt; gets dropped, too.

See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1265 in a browser that implements the HTML parsing algorithm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60722</commentid>
    <comment_count>2</comment_count>
    <who name="Henry S. Thompson">ht</who>
    <bug_when>2011-12-01 09:50:44 +0000</bug_when>
    <thetext>Thanks for the example, which is equivalent to what I did look at in both FF and Chrome, which I guess do not implement the HTML parsing algorithm (in the versions I&apos;m using) . . .

What browser do you recommend at the moment for this kind of exploration?

This does make it impossible to produce polyglot which begins a &lt;pre&gt; with a newline :-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60774</commentid>
    <comment_count>3</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-12-02 14:20:05 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Thanks for the example, which is equivalent to what I did look at in both FF
&gt; and Chrome, which I guess do not implement the HTML parsing algorithm (in the
&gt; versions I&apos;m using) . . .

Chrome seems to have a bug here.

Which version of Firefox did you use? Firefox should behave per spec here.

&gt; What browser do you recommend at the moment for this kind of exploration?

The latest version of Firefox or Opera 11.60 or newer.

Chrome implemented a snapshot of the HTML parsing algorithm in 7 or 8 and hasn&apos;t updated their implementation since, so Chrome doesn&apos;t reflect the more recent spec changes. However, I think in this case Chrome is buggy even according to the way the spec was at the time Chrome implemented.

&gt; This does make it impossible to produce polyglot which begins a &lt;pre&gt; with a
&gt; newline :-(

Yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60775</commentid>
    <comment_count>4</comment_count>
    <who name="Henry S. Thompson">ht</who>
    <bug_when>2011-12-02 14:38:48 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Thanks for the example, which is equivalent to what I did look at in both FF
&gt; &gt; and Chrome, which I guess do not implement the HTML parsing algorithm (in the
&gt; &gt; versions I&apos;m using) . . .
&gt; 
&gt; Chrome seems to have a bug here.
&gt; 
&gt; Which version of Firefox did you use? Firefox should behave per spec here.

3.6.4 -- Sorry, I had no idea I was so far out of date with FF.
8.0.1 behaves as you suggest.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>