Closed
Bug 346083
Opened 18 years ago
Closed 18 years ago
Crash [@ nsBoxObject::SetProperty] passing undefined to setProperty
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: smaug)
Details
(Keywords: crash, testcase)
Crash Data
Attachments
(4 files)
135 bytes,
text/html
|
Details | |
1.23 KB,
patch
|
bzbarsky
:
review-
bzbarsky
:
superreview-
|
Details | Diff | Splinter Review |
2.80 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
2.78 KB,
patch
|
Details | Diff | Splinter Review |
Passing undefined to boxObj.setProperty causes a crash [@ nsBoxObject::SetProperty]. This is similar to bug 327776, so the fix will probably be similar.
Reporter | ||
Comment 1•18 years ago
|
||
Assignee | ||
Comment 2•18 years ago
|
||
I think removing property when undefined or null is used as value makes sense.
Assignee: general → Olli.Pettay
Status: NEW → ASSIGNED
Attachment #230885 -
Flags: superreview?(bzbarsky)
Attachment #230885 -
Flags: review?(bzbarsky)
Comment 3•18 years ago
|
||
Comment on attachment 230885 [details] [diff] [review] proposed patch I don't like the magic "read your mind" thing with removing. Not only that, but that would make this inconsistent with SetPropertyAsSupports. Why not just set to a null PRUnichar or to EmptyString.get() or something?
Attachment #230885 -
Flags: superreview?(bzbarsky)
Attachment #230885 -
Flags: superreview-
Attachment #230885 -
Flags: review?(bzbarsky)
Attachment #230885 -
Flags: review-
Assignee | ||
Comment 4•18 years ago
|
||
Null PRUnichar makes nsDependentString to crash and EmptyString.get() != null. I want that if someone uses setProperty('foo', null) getProperty('foo') returns null, not empty string. But new patch coming.
Assignee | ||
Comment 5•18 years ago
|
||
or no (new patch). I'd have to change nsPresState::GetStateProperty too. It returns NS_STATE_PROPERTY_NOT_THERE/null if the property is either null or doesn't exist.
Comment 6•18 years ago
|
||
Last I checked, we wanted to stop using nsPresState here anyway. If you can store null for now and just deal with the nsDependentString issue, we can fix the behavior when we don't use nsPresState, I guess... roc may have opinions; he's looked at this code more than I recently.
Assignee | ||
Comment 7•18 years ago
|
||
This at least should do the right thing - storing null strings as properties. (I should file a bug so that IsVoid flags is copied automatically when converting strings)
Attachment #230973 -
Flags: superreview?(bzbarsky)
Attachment #230973 -
Flags: review?(bzbarsky)
Comment 8•18 years ago
|
||
Comment on attachment 230973 [details] [diff] [review] store null strings >Index: layout/base/nsPresState.cpp >+ nsCAutoString data = NS_ConvertUTF16toUTF8(aValue); >+ data.SetIsVoid(aValue.IsVoid()); How about: NS_ConvertUTF16toUTF8 data(aValue); data.SetIsVoid(aValue.IsVoid()); Rest looks good.
Attachment #230973 -
Flags: superreview?(bzbarsky)
Attachment #230973 -
Flags: superreview+
Attachment #230973 -
Flags: review?(bzbarsky)
Attachment #230973 -
Flags: review+
Assignee | ||
Comment 9•18 years ago
|
||
Assignee | ||
Updated•18 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Verified FIXED using https://bugzilla.mozilla.org/attachment.cgi?id=230883&action=view as the testcase with build 2006-07-28-07 of SeaMonkey trunk under Windows XP; no crash.
Status: RESOLVED → VERIFIED
Updated•13 years ago
|
Crash Signature: [@ nsBoxObject::SetProperty]
Updated•11 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•