Bug 620267 Certain LFs following a <pre> or <textarea> get erroneously stripped r=hsivonen a=bz

This commit is contained in:
Neil Rashbrook 2011-01-05 23:49:55 +00:00
parent 59075a58ed
commit b22f4f1a18
2 changed files with 2 additions and 2 deletions

View File

@ -832,6 +832,7 @@ public abstract class TreeBuilder<T> implements TokenHandler,
public final void characters(@Const @NoLength char[] buf, int start, int length)
throws SAXException {
if (needToDropLF) {
needToDropLF = false;
if (buf[start] == '\n') {
start++;
length--;
@ -839,7 +840,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
return;
}
}
needToDropLF = false;
}
// optimize the most common case

View File

@ -177,6 +177,7 @@ void
nsHtml5TreeBuilder::characters(const PRUnichar* buf, PRInt32 start, PRInt32 length)
{
if (needToDropLF) {
needToDropLF = PR_FALSE;
if (buf[start] == '\n') {
start++;
length--;
@ -184,7 +185,6 @@ nsHtml5TreeBuilder::characters(const PRUnichar* buf, PRInt32 start, PRInt32 leng
return;
}
}
needToDropLF = PR_FALSE;
}
switch(mode) {
case NS_HTML5TREE_BUILDER_IN_BODY: