mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 495663 - Count newlines correctly if we have an alternate ending position. r+sr=sicking
This commit is contained in:
parent
ed18be0cf5
commit
c1dd12b814
@ -775,6 +775,7 @@ CTextToken::ConsumeParsedCharacterData(PRBool aDiscardFirstNewline,
|
||||
|
||||
nsScannerIterator currPos, endPos, altEndPos;
|
||||
PRUint32 truncPos = 0;
|
||||
PRInt32 truncNewlineCount = 0;
|
||||
aScanner.CurrentPosition(currPos);
|
||||
aScanner.EndReading(endPos);
|
||||
|
||||
@ -839,6 +840,7 @@ CTextToken::ConsumeParsedCharacterData(PRBool aDiscardFirstNewline,
|
||||
// We ran out of room looking for a </title>. Go back to the first
|
||||
// place that looked like a tag and use that as our stopping point.
|
||||
theContent.writable().Truncate(truncPos);
|
||||
mNewlineCount = truncNewlineCount;
|
||||
aScanner.SetPosition(altEndPos, PR_FALSE, PR_TRUE);
|
||||
}
|
||||
// else we take everything we consumed.
|
||||
@ -857,6 +859,7 @@ CTextToken::ConsumeParsedCharacterData(PRBool aDiscardFirstNewline,
|
||||
// Keep this position in case we need it for later.
|
||||
altEndPos = currPos;
|
||||
truncPos = theContent.str().Length();
|
||||
truncNewlineCount = mNewlineCount;
|
||||
}
|
||||
|
||||
if (Distance(currPos, endPos) >= termStrLen) {
|
||||
|
Loading…
Reference in New Issue
Block a user