Closed
Bug 17950
Opened 25 years ago
Closed 25 years ago
Inconsistent line termination causes page to render incorrectly
Categories
(Core :: DOM: HTML Parser, defect, P3)
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: sfraser_bugs, Assigned: rickg)
References
()
Details
(Whiteboard: [testcase needed])
The page at the URL above contains mostly CRLF line termination, but has isolated LFs in a few places. This page renders fine in 4.5, but renders incorrectly in apprunner. Things to bad after the end of the main story (just after the "******** "Search/ Back to top" ********" comment).
The bug appears to be in the parser::comment code. Here's a reduced test case: <html> <body> <FONT SIZE=1 FACE="Arial, Helvetica"> Text here! </FONT> <!--******** "Search/Back to top" ******** component --> <IMG SRC="/furniture/rickgerror.gif" WIDTH=328 HEIGHT=1><BR> <FORM ACTION="/scripts/query.idq" METHOD=GET> <INPUT SIZE=30 NAME="CiRestriction" TYPE="TEXT"> <INPUT VALUE=32 NAME="CiMaxRecordsPerPage" TYPE="HIDDEN"> </FORM> end of text </body> </html>
Reporter | ||
Comment 3•25 years ago
|
||
This bug causes almost all the pages at <http://news.bbc.co.uk> to render incorrectly.
Reporter | ||
Updated•25 years ago
|
Whiteboard: [testcase needed]
Simon -- here's the updated version of CNewLineToken::Consume(); it lives in the file nsHTMLTokens.cpp. Please apply this change, build and run to see if it fixes this problem for you. Thanks. /* * Consume as many cr/lf pairs as you can find. * * @update gess 3/25/98 * @param aChar -- last char consumed from stream * @param aScanner -- controller of underlying input source * @return error result */ nsresult CNewlineToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) { mTextValue=kNewLine; //This is what I THINK we should be doing. /******************************************************************* Here's what the HTML spec says about newlines: "A line break is defined to be a carriage return (
), a line feed (
), or a carriage return/line feed pair. All line breaks constitute white space." *******************************************************************/ PRUnichar theChar; nsresult result=aScanner.Peek(theChar); if(NS_OK==result) { switch(aChar) { case kNewLine: if(kCR==theChar) { result=aScanner.GetChar(theChar); } break; case kCR: //convert CRLF into simple newline if(kNewLine==theChar) { result=aScanner.GetChar(theChar); } break; default: break; } } return result; }
Updated•25 years ago
|
Target Milestone: M13
Comment 5•25 years ago
|
||
I'm setting this to M13 -- Simon, if you can get to this before then, the reset the milestone date.
Reporter | ||
Comment 6•25 years ago
|
||
I'm not seeing the problem in a current build even before I apply this patch. The test page above renders reasonably well (if slowly).
Reporter | ||
Updated•25 years ago
|
Assignee: sfraser → rickg
Reporter | ||
Comment 7•25 years ago
|
||
It renders OK with the patch too, so the patch didn't make any difference in this case. This bug must have been fixed elsewhere.
Reporter | ||
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 8•25 years ago
|
||
Marking fixed, since the problem no longer occurs.
Comment 10•23 years ago
|
||
Verified on build: 2001-05-29-20-Trunk platform: Win NT The attached url loads ok.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•