Open
Bug 423228
Opened 16 years ago
Updated 2 years ago
Different handling of unpaired surrogate from Acid3 test 68 (when INPUT in HTML, convert to U+FFFD is done on reload, not on putting in INPUT.value)
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
NEW
People
(Reporter: World, Unassigned)
References
Details
Attachments
(1 file)
1.43 KB,
text/html
|
Details |
When Acd3 test 68, convert of unpaired surrogate to U+FFFD is executed on INPUT.value=<unpaired surrogate> (or getting value by x=INPUT.value).
> var unpaired = String.fromCharCode(0xd863); // half a surrogate pair
> var before = unpaired + "text";
> var elt = document.createElement("input");
> elt.value = before;
> var after = elt.value;
> ==> When Fx trunk, converted to U+FFFD + ext at this step
However, when <INPUT> tag in HTML, conversion to U+FFFD is not executed by
"elt.value=before" nor "var after=elt.value" step.
Coversion was done on Reload.
(If bfcache is off, this was done on Back or Forward too.)
(Phenomenon can be observed with TEXTAREA too.)
I guess this difference is caused by existence of text node.
I don't know when conversion to U+FFFD have to be executed.
Reporter | ||
Comment 1•16 years ago
|
||
When putting data in INPUT.value by JavaScript, following logic is valid, I think. 1. INPUT.value=<unpaired surrogate(first/most significant)> 2. var x=INPUT.value, and check data in x 3. INPUT.value += <unpaired surrogate(second/least significant)> ==> INPUT.value becomes valid surrogate pair When INPUT tag in HTML, I think current result of step 2 & step 3 is same as user's expectation and I think it is correct behaviour. However, Acid3 test 68 expects different result when INPUT.value just after document.createElement('input)'. 0. document.createElement('input)' 1. INPUT.value=<unpaired surrogate(first/most significant)> 2. var x=INPUT.value, and check data in x ==> (2-A) Content of INPUT.value is changed to U+FFFD (2-B) Data placed in var x only becomes U+FFFD 3. INPUT.value += <unpaired surrogate(second/least significant)> ==> If (2-A), INPUT.value is corrupted ==> If (2-B), INPUT.value becomes correct surrogate pair. However, it is inconsistent with result of step 2. (step 2 says U+FFFD is held in INPUT.value) 4. appendChild to a parent element will be executed usually When, on what condition, for what element or object, the unpaired surrogate is to be converted to U+FFFD? Original data itslef is to be converted? Or only when reference/display? Expectation/assumption by current Acid3 test 68 is proper?
Comment 2•16 years ago
|
||
This bug also is reproduced on Firefox Linux trunk.
Reporter | ||
Updated•15 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•