Closed
Bug 29521
Opened 25 years ago
Closed 25 years ago
nsGfxTextControlFrame::SaveState trash non ASCII data.
Categories
(Core :: Layout: Form Controls, defect, P3)
Core
Layout: Form Controls
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: ftang, Assigned: sfraser_bugs)
References
Details
(Whiteboard: [PDT+] need ftang's verification, comments)
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Here is another place which trash non ASCII data.
I caught this when I trun on the assertion in 28424 and add "serach result" to
the side bar, and type in some non ASCII text
I think this is another cause of 22580
nsString::ToNewCString() line 671
nsGfxTextControlFrame::SaveState(nsGfxTextControlFrame * const 0x025565f4,
nsIPresContext * 0x030d3b20, nsIPresState * * 0x0012d1d8) line 3225 + 12 bytes
CaptureFrameStateFor(nsIPresContext * 0x030d3b20, nsIFrame * 0x02556590,
nsILayoutHistoryState * 0x0332d080) line 1402 + 40 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556590, nsILayoutHistoryState * 0x0332d080) line
1420 + 17 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556550, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556510, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x025564cc, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556080, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556044, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
FrameManager::CaptureFrameState(FrameManager * const 0x03025fc0, nsIPresContext
* 0x030d3b20, nsIFrame * 0x02556008, nsILayoutHistoryState * 0x0332d080) line
1429 + 24 bytes
NS_IMETHODIMP
nsGfxTextControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState**
aState)
{
// Construct a pres state.
NS_NewPresState(aState); // The addref happens here.
nsAutoString theString;
nsresult res = GetProperty(nsHTMLAtoms::value, theString);
if (NS_SUCCEEDED(res)) {
char* chars = theString.ToNewCString();
the theString.ToNewCString simply trash non ASCII data.
Reporter | ||
Updated•25 years ago
|
Reporter | ||
Comment 1•25 years ago
|
||
reassign to rods since cvsblame show me he check in those lines in 3.136
Put beta1 in the keyword since it block 22580.
Reporter | ||
Comment 2•25 years ago
|
||
The other odd thing in this code is it call the char* version of
nsLinebreakConverter::ConvertLineBreaks , while sfraser did provide a PRUnichar*
version of nsLinebreakConverter::ConvertLineBreaks
This code should call ToNewUnicode() and use PRUnichar* as type instead
Comment 3•25 years ago
|
||
I am blamed for this because I copied the code from nsTextControlframe and I was
compression the inheritence hierarchy. sfraser is the original author of this
code and beter understands what is going on with the line breaking code etc.
reassigning to sfraser
Assignee: rods → sfraser
Updated•25 years ago
|
Target Milestone: M14
Simon -- we're marking this PDT+ based on the premise that it's just a matter of
which linebreak converter to call. Assuming you can have this fixed by 3/3.
Whiteboard: [PDT+]
Reporter | ||
Comment 6•25 years ago
|
||
No, 22580 is not a DUP of this. 22580 is DEPEND on this and others. 22580 is
what user see. This is ONE of the problem caughted by whitebox QA.
Comment 7•25 years ago
|
||
Thanks, I didn't see it was already marked as a dependency, I just wanted to
make sure that somewhere it was noted there is likely to be a connection between
the two.
Assignee | ||
Comment 8•25 years ago
|
||
Assignee | ||
Comment 9•25 years ago
|
||
Added a diff attachment to the bug. ftang, please review.
I think we also need to inspect all the other places where linebreak conversion
happens on form control contents:
nsFormFrame::URLEncode()
nsFormFrame::ProcessAsMultipart() (2 places)
Note that in none of these cases did I break i18n stuff. Before I put in the
linebreak conversion code, we were already messing with char* data, instead of
PRUnichar* data.
Status: NEW → ASSIGNED
Updated•25 years ago
|
Whiteboard: [PDT+] → [PDT+] fix waiting for ftang's review
Assignee | ||
Comment 10•25 years ago
|
||
I don't believe that we should mess with the code in nsFormFrame at this point.
That code needs i18n review.
Assignee | ||
Comment 11•25 years ago
|
||
Fix checked in
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 12•25 years ago
|
||
ftang, could you verify and comment? Thanks! -ckritzer
Updated•25 years ago
|
Whiteboard: [PDT+] fix waiting for ftang's review → [PDT+] need ftang's verification, comments
Reporter | ||
Comment 13•25 years ago
|
||
yes, this have been fix and check in. Verify 22580 can verfiy this bug.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•