Bug 566280 - Text run prefixed by U+0000 shows only U+FFFD. r=sicking.
authorHenri Sivonen <hsivonen@iki.fi>
Thu, 27 May 2010 16:08:19 +0300
changeset 43389 14bb99ed59c8d5c3947b1b2853f77e1c3c0039ad
parent 43388 a8ac411e1653c2a2359aa5a76e3f0bc45d99aca5
child 43390 1643049fe4d3ddd87b3e8f4446a6ff4dce8222d3
push idunknown
push userunknown
push dateunknown
reviewerssicking
bugs566280
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 566280 - Text run prefixed by U+0000 shows only U+FFFD. r=sicking.
layout/reftests/bugs/228856-2-style-1.css
layout/reftests/bugs/228856-2.html
layout/reftests/reftest.list
parser/html/javasrc/Tokenizer.java
parser/html/nsHtml5Tokenizer.cpp
parser/htmlparser/tests/reftest/bug566280-1-ref.html
parser/htmlparser/tests/reftest/bug566280-1.html
parser/htmlparser/tests/reftest/reftest.list
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a6d6acf36a1f9e09007d24dfbf9d57b016d870c5
GIT binary patch
literal 1019
zc${sL&2ED*5QI7BDOTbTDH0A%()_@weTE*n7~_IfV_UYHs*3vVH30!3%W=LP?=bcX
zz`(7gwiYTWwfDNs(j1tU+GeGs>??;)t$gysMcw$U)UwLqZw25j+~CTs7mUh;N>Qr}
zyf!_o0yMO$gsKyJcS1^Dc^hcJ+YOZAXxEKzwn3=GH5mG>P+QJbzcz!T@z83eouQ29
zqy3}dj)UWpGq0@!*XVCqfzn}`de#6{zrG3E3G^G{A{8&w4$G^1&{!1d4wLsqipY^T
zV8hWXrXC|qJpnA`ppznHNIb&Oc!Z(xNW_qMgkkXr!{QN!$BV_8poNGFL614dXh3#}
zpT_4GYOFThlj09ITJrGPIQ3ziI#^Hc^?19cE3ZiJ-!h}wjqEAE*>`aU<B}aF21_<p
pI(X;o_{d<+PSfuX&WW9uZ05VnY8#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me/reftest.list
 include ../../netwerk/test/reftest/reftest.list
 
 # object/
 include object/reftest.list
 
 # ogg-video/
 include ogg-video/reftest.list
 
+# parser/
+include ../../parser/htmlparser/tests/reftest/reftest.list
+
 # percent-overflow-sizing/
 include percent-overflow-sizing/reftest.list
 
 # pixel-rounding/
 include pixel-rounding/reftest.list
 
 # plugin/
 include ../../modules/plugin/test/reftest/reftest.list
--- a/parser/html/javasrc/Tokenizer.java
+++ b/parser/html/javasrc/Tokenizer.java
@@ -5853,20 +5853,19 @@ public class Tokenizer implements Locato
         silentCarriageReturn();
         flushChars(buf, pos);
         tokenHandler.characters(Tokenizer.LF, 0, 1);
         cstart = Integer.MAX_VALUE;
     }
 
     private void emitReplacementCharacter(@NoLength char[] buf, int pos)
             throws SAXException {
-        silentCarriageReturn();
         flushChars(buf, pos);
         tokenHandler.characters(Tokenizer.REPLACEMENT_CHARACTER, 0, 1);
-        cstart = Integer.MAX_VALUE;
+        cstart = pos + 1;
     }
 
     private void setAdditionalAndRememberAmpersandLocation(char add) {
         additional = add;
         // [NOCPP[
         ampersandLocation = new LocatorImpl(this);
         // ]NOCPP]
     }
--- a/parser/html/nsHtml5Tokenizer.cpp
+++ b/parser/html/nsHtml5Tokenizer.cpp
@@ -3333,20 +3333,19 @@ nsHtml5Tokenizer::emitCarriageReturn(PRU
   flushChars(buf, pos);
   tokenHandler->characters(nsHtml5Tokenizer::LF, 0, 1);
   cstart = PR_INT32_MAX;
 }
 
 void 
 nsHtml5Tokenizer::emitReplacementCharacter(PRUnichar* buf, PRInt32 pos)
 {
-  silentCarriageReturn();
   flushChars(buf, pos);
   tokenHandler->characters(nsHtml5Tokenizer::REPLACEMENT_CHARACTER, 0, 1);
-  cstart = PR_INT32_MAX;
+  cstart = pos + 1;
 }
 
 void 
 nsHtml5Tokenizer::setAdditionalAndRememberAmpersandLocation(PRUnichar add)
 {
   additional = add;
 }
 
new file mode 100644
--- /dev/null
+++ b/parser/htmlparser/tests/reftest/bug566280-1-ref.html
@@ -0,0 +1,2 @@
+<body>&#xFFFD;hello world
+
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3aa60caf343f365c2d69988ce78564de20fcdb4e
GIT binary patch
literal 19
ac$~9I%1^1ZW5`I&$;nqJ&o9bJ;Q|0b>jsYi
new file mode 100644
--- /dev/null
+++ b/parser/htmlparser/tests/reftest/reftest.list
@@ -0,0 +1,2 @@
+== bug566280-1.html bug566280-1-ref.html
+