<?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>13309</bug_id>
          
          <creation_ts>2011-07-20 12:08:37 +0000</creation_ts>
          <short_desc>HTML and XHTML handle newline differently</short_desc>
          <delta_ts>2011-08-09 23:17:46 +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>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Franklin Tse">peaceable_whale</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>hsivonen</cc>
    
    <cc>ian</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>51316</commentid>
    <comment_count>0</comment_count>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 12:08:37 +0000</bug_when>
    <thetext>text/html and application/xhtml+xml documents currently have 2 different newline handling rules, causing inconsistent rendering even when the markup is the same. The rule for text/html ignores character reference of U+000D CARRIAGE RETURN (Section 8.1.3.1 of HTML 5 spec) while the rule for application/xhtml document translates both the two-character sequence #xD #xA and any #xD that is not followed by #xA to a single #xA character. (Section 2.11 of XML spec).

Should HTML 5 follow the handling rule of XML?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51320</commentid>
    <comment_count>1</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-07-20 14:30:15 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the tracker issue; or you may create a tracker issue
yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: The spec already says what is requested
Change Description: no spec change
Rationale:

HTML5 doesn&apos;t ignore carriage returns. Lone literal carriage returns turn into line feeds. So does the CRLF pair. An escaped carriage return ends up in the DOM as a carriage return.

Just like in XML.

I don&apos;t know which particular passage or sentence in which particular publication you are referring to, so I can&apos;t comment on the exact text that made it seem as though this wasn&apos;t already the case. For future bugs: Please avoid referring to the section numbers of the HTML5 spec. The numbering changes all the time and differs between different views and publication venues of HTML5. In the future, please use a URL with a fragment id part to refer to a section of the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51321</commentid>
    <comment_count>2</comment_count>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:34:59 +0000</bug_when>
    <thetext>Under Section 8.1.3.1 of HTML 5:

&quot;Where character references are allowed, a character reference of a U+000A LINE FEED (LF) character (but not a U+000D CARRIAGE RETURN (CR) character) also represents a newline.&quot;

In other words, &amp;#xD; is ignored.

I will upload some browser test results to this report soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51322</commentid>
    <comment_count>3</comment_count>
      <attachid>1013</attachid>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:36:45 +0000</bug_when>
    <thetext>Created attachment 1013
text/html test document</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51323</commentid>
    <comment_count>4</comment_count>
      <attachid>1014</attachid>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:37:23 +0000</bug_when>
    <thetext>Created attachment 1014
application/xhtml+xml test document</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51324</commentid>
    <comment_count>5</comment_count>
      <attachid>1015</attachid>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:39:27 +0000</bug_when>
    <thetext>Created attachment 1015
Firefox 5 and Chrome 12 output of both HTML and XHTML documents</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51325</commentid>
    <comment_count>6</comment_count>
      <attachid>1016</attachid>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:39:51 +0000</bug_when>
    <thetext>Created attachment 1016
IE 9 output of text/html document</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51326</commentid>
    <comment_count>7</comment_count>
      <attachid>1017</attachid>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:40:35 +0000</bug_when>
    <thetext>Created attachment 1017
IE 9 output of application/xhtml+xml document and Opera output for both HTML and XHTML</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51327</commentid>
    <comment_count>8</comment_count>
    <who name="Franklin Tse">peaceable_whale</who>
    <bug_when>2011-07-20 14:43:11 +0000</bug_when>
    <thetext>IE 9&apos;s text/html output is buggy while application/xhtml+xml output follows XML spec. Firefox and Chrome use HTML 5&apos;s handling regardless of media type. Opera uses XML spec&apos;s handling regardless of media type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52435</commentid>
    <comment_count>9</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:01:27 +0000</bug_when>
    <thetext>mass-moved component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54497</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-09 23:17:46 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Under Section 8.1.3.1 of HTML 5:
&gt; 
&gt; &quot;Where character references are allowed, a character reference of a U+000A LINE
&gt; FEED (LF) character (but not a U+000D CARRIAGE RETURN (CR) character) also
&gt; represents a newline.&quot;
&gt; 
&gt; In other words, &amp;#xD; is ignored.

No, what you quote is not at all saying that &amp;#xD; is ignored. It&apos;s saying that if you want to represent a newline, you can use &amp;#xA;, but not &amp;#xD;.

If you read the parser section, you&apos;ll see &amp;#xD; turns into a U+000D character, which doesn&apos;t represent anything useful in HTML.


EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Spec is as intended.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1013</attachid>
            <date>2011-07-20 14:36:45 +0000</date>
            <delta_ts>2011-07-20 14:36:45 +0000</delta_ts>
            <desc>text/html test document</desc>
            <filename>linebreak-test.html</filename>
            <type>text/html</type>
            <size>390</size>
            <attacher name="Franklin Tse">peaceable_whale</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRt
bCI+DQo8aGVhZD4NCjxtZXRhIGNoYXJzZXQ9IlVURi04IiAvPg0KPHRpdGxlPkxpbmUgQnJlYWsg
Q2hhcmFjdGVyIFJlZmVyZW5jZSBUZXN0PC90aXRsZT4NCjwvaGVhZD4NCjxib2R5Pg0KPHByZT5M
aW5lIDEmI3gwQTtMaW5lIDImI3gwRDtMaW5lIDMmI3gwRDsmI3gwQTtMaW5lIDQmI3gwQTsmI3gw
RDtMaW5lIDYmI3gwQTsmI3gwRDsmI3gwQTtMaW5lIDgmI3gwRDsmI3gwRDsmI3gwQTtMaW5lIDEw
JiN4MEQ7JiN4MEE7JiN4MEQ7TGluZSAxMiYjeDBEOyYjeDBBOyYjeDBBO0xpbmUgMTQmI3gwRDsm
I3gwQTsmI3gwRDsmI3gwQTtMaW5lIDE2PC9wcmU+DQo8L2JvZHk+DQo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1014</attachid>
            <date>2011-07-20 14:37:23 +0000</date>
            <delta_ts>2011-07-20 14:37:23 +0000</delta_ts>
            <desc>application/xhtml+xml test document</desc>
            <filename>linebreak-test.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>390</size>
            <attacher name="Franklin Tse">peaceable_whale</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRt
bCI+DQo8aGVhZD4NCjxtZXRhIGNoYXJzZXQ9IlVURi04IiAvPg0KPHRpdGxlPkxpbmUgQnJlYWsg
Q2hhcmFjdGVyIFJlZmVyZW5jZSBUZXN0PC90aXRsZT4NCjwvaGVhZD4NCjxib2R5Pg0KPHByZT5M
aW5lIDEmI3gwQTtMaW5lIDImI3gwRDtMaW5lIDMmI3gwRDsmI3gwQTtMaW5lIDQmI3gwQTsmI3gw
RDtMaW5lIDYmI3gwQTsmI3gwRDsmI3gwQTtMaW5lIDgmI3gwRDsmI3gwRDsmI3gwQTtMaW5lIDEw
JiN4MEQ7JiN4MEE7JiN4MEQ7TGluZSAxMiYjeDBEOyYjeDBBOyYjeDBBO0xpbmUgMTQmI3gwRDsm
I3gwQTsmI3gwRDsmI3gwQTtMaW5lIDE2PC9wcmU+DQo8L2JvZHk+DQo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1015</attachid>
            <date>2011-07-20 14:39:27 +0000</date>
            <delta_ts>2011-07-20 14:41:48 +0000</delta_ts>
            <desc>Firefox 5 and Chrome 12 output of both HTML and XHTML documents</desc>
            <filename>firefox+chrome_result.txt</filename>
            <type>text/plain</type>
            <size>86</size>
            <attacher name="Franklin Tse">peaceable_whale</attacher>
            
              <data encoding="base64">TGluZSAxDQpMaW5lIDJMaW5lIDMNCkxpbmUgNA0KTGluZSA2DQoNCkxpbmUgOA0KTGluZSAxMA0K
TGluZSAxMg0KDQpMaW5lIDE0DQoNCkxpbmUgMTY=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1016</attachid>
            <date>2011-07-20 14:39:51 +0000</date>
            <delta_ts>2011-07-20 14:39:51 +0000</delta_ts>
            <desc>IE 9 output of text/html document</desc>
            <filename>ie9html_result.txt</filename>
            <type>text/plain</type>
            <size>108</size>
            <attacher name="Franklin Tse">peaceable_whale</attacher>
            
              <data encoding="base64">TGluZSAxDQpMaW5lIDINCkxpbmUgMw0KDQpMaW5lIDQNCg0KTGluZSA2DQoNCg0KTGluZSA4DQoN
Cg0KTGluZSAxMA0KDQoNCkxpbmUgMTINCg0KDQpMaW5lIDE0DQoNCg0KDQpMaW5lIDE2
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1017</attachid>
            <date>2011-07-20 14:40:35 +0000</date>
            <delta_ts>2011-07-20 14:40:35 +0000</delta_ts>
            <desc>IE 9 output of application/xhtml+xml document and Opera output for both HTML and XHTML</desc>
            <filename>ie9xhtml+opera_result.txt</filename>
            <type>text/plain</type>
            <size>94</size>
            <attacher name="Franklin Tse">peaceable_whale</attacher>
            
              <data encoding="base64">TGluZSAxDQpMaW5lIDINCkxpbmUgMw0KTGluZSA0DQoNCkxpbmUgNg0KDQpMaW5lIDgNCg0KTGlu
ZSAxMA0KDQpMaW5lIDEyDQoNCkxpbmUgMTQNCg0KTGluZSAxNg==
</data>

          </attachment>
      

    </bug>

</bugzilla>