This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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. , should be used.
(In reply to comment #0) > 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. , 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't know if the character originated from a character reference, so immediately after <pre> gets dropped, too. See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1265 in a browser that implements the HTML parsing algorithm.
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'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 <pre> with a newline :-(
(In reply to comment #2) > 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'm using) . . . Chrome seems to have a bug here. Which version of Firefox did you use? Firefox should behave per spec here. > 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't updated their implementation since, so Chrome doesn'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. > This does make it impossible to produce polyglot which begins a <pre> with a > newline :-( Yes.
(In reply to comment #3) > (In reply to comment #2) > > 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'm using) . . . > > Chrome seems to have a bug here. > > 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.