Closed
Bug 339774
Opened 18 years ago
Closed 18 years ago
nsDOMEvent::DuplicatePrivateData should copy more things from the original event
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(2 files)
10.08 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
5.64 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Currently for example keyCode and charCode are set to 0, not copied from the original event. This is not needed once nsEvent is gone (and this may take still some time), but before that I'd like it to work properly.
Assignee | ||
Comment 1•18 years ago
|
||
This is a bit ugly, but so is everything related to ::DuplicatePrivateData. I decided to copy all possible members of nsEvent-classes. Members which refer to some external object are set to nsnull (by the constructors of the nsEvent classes). nsTextEvent is a bit different, it really can't be copied, and nsPopupBlockedEvent is used always only with DOM Events (otherwise the handling of the two owning pointers wouldn't really work) Because of Bug 339697 this is needed also in branch. The branch patch will be a bit different, mainly just the handling of the target of the event.
Attachment #223963 -
Flags: superreview?(jst)
Attachment #223963 -
Flags: review?(jst)
Assignee | ||
Comment 2•18 years ago
|
||
And I removed that invalid comment about trusted events. Event will be trusted after duplication, but not perhaps after Init()
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Comment 3•18 years ago
|
||
Comment on attachment 223963 [details] [diff] [review] ugly, but still proposed patch r+sr=jst
Attachment #223963 -
Flags: superreview?(jst)
Attachment #223963 -
Flags: superreview+
Attachment #223963 -
Flags: review?(jst)
Attachment #223963 -
Flags: review+
Assignee | ||
Comment 4•18 years ago
|
||
Checking in nsDOMEvent.cpp; /cvsroot/mozilla/content/events/src/nsDOMEvent.cpp,v <-- nsDOMEvent.cpp new revision: 1.210; previous revision: 1.209 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•18 years ago
|
||
prometheus didn't like this
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 6•18 years ago
|
||
It just needed curly brackets. Checking in nsDOMEvent.cpp; /cvsroot/mozilla/content/events/src/nsDOMEvent.cpp,v <-- nsDOMEvent.cpp new revision: 1.212; previous revision: 1.211 done
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•18 years ago
|
||
Balsa showed some leaks. I checked in the following to see whether it helps - NS_STATIC_CAST(nsXULCommandEvent*, newEvent)->sourceEvent = - NS_STATIC_CAST(nsXULCommandEvent*, mEvent)->sourceEvent; + /* Disabling for now. This creates some leaks. + NS_STATIC_CAST(nsXULCommandEvent*, newEvent)->sourceEvent = + NS_STATIC_CAST(nsXULCommandEvent*, mEvent)->sourceEvent; */ At least locally I did see that with that code nsDOMXULCommandEvents were leaked, which means also their targets were leaked.
Comment 8•18 years ago
|
||
Er... That sounds like we leak nsEvent structs. Could we add some CTOR/DTOR logging to nsEvent and see what balsa shows? I can't believe we don't have any such logging now...
Assignee | ||
Comment 9•18 years ago
|
||
I commented out the code related to mutation events. That helps too (at least locally). Otherwise nsDOMAttributes are leaked. still investigating.
Assignee | ||
Comment 10•18 years ago
|
||
This re-enables proper DuplicatePrivateData for mutation and command events and fixes the leaks.
Attachment #224419 -
Flags: superreview?(bzbarsky)
Attachment #224419 -
Flags: review?(bzbarsky)
Comment 11•18 years ago
|
||
Comment on attachment 224419 [details] [diff] [review] fixes leaks Looks good, I guess. When we move away to combining nsEvent and nsDOMEvent, this fragility will hopefully go away...
Attachment #224419 -
Flags: superreview?(bzbarsky)
Attachment #224419 -
Flags: superreview+
Attachment #224419 -
Flags: review?(bzbarsky)
Attachment #224419 -
Flags: review+
Assignee | ||
Comment 12•18 years ago
|
||
Comment on attachment 224419 [details] [diff] [review] fixes leaks Checked in. Leaks ok.
You need to log in
before you can comment on or make changes to this bug.
Description
•