Closed
Bug 437640
Opened 17 years ago
Closed 17 years ago
ability to remove <keyset>s
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 4 obsolete files)
|
13.88 KB,
patch
|
neil
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
1. allow keysets to be removed and have their listener removed
2. support a disabled attribute to disable keysets
Couldn't think of a better way to retrieve the listener again so I store it as a property of the keyset.
Attachment #324059 -
Flags: superreview?(neil)
Attachment #324059 -
Flags: review?(neil)
Comment 1•17 years ago
|
||
Comment on attachment 324059 [details] [diff] [review]
support this
For some reason I'm not seeing the event listeners get removed corretly - the keydown listener is OK but the other two aren't.
| Assignee | ||
Comment 2•17 years ago
|
||
(In reply to comment #1)
> (From update of attachment 324059 [details] [diff] [review])
> For some reason I'm not seeing the event listeners get removed corretly - the
> keydown listener is OK but the other two aren't.
I don't see this problem. How are you checking this?
Comment 3•17 years ago
|
||
(In reply to comment #2)
> (In reply to comment #1)
> > (From update of attachment 324059 [details] [diff] [review] [details])
> > For some reason I'm not seeing the event listeners get removed corretly - the
> > keydown listener is OK but the other two aren't.
> I don't see this problem. How are you checking this?
1. Open DOMi and use it to inspect the browser
2. Pick a keyset and remove it from the DOM
3. Switch back to the browser and press a key in that keyset
Actual results: assertion "element must be in document"
Comment 4•17 years ago
|
||
I also breakpointed in nsEventListenerManager::RemoveEventListener mListeners.RemoveElementAt(i); and it was only hit once.
| Assignee | ||
Comment 5•17 years ago
|
||
Hmmm. It seems that the same keyset is being added multiple times, thus there are extra listeners.
| Assignee | ||
Comment 6•17 years ago
|
||
Minor change to just not add a listener if one already exists.
The bug of adding it multiple times is probably something in the document/overlay loading code and should be a different bug.
Attachment #324059 -
Attachment is obsolete: true
Attachment #324289 -
Flags: superreview?(neil)
Attachment #324289 -
Flags: review?(neil)
Attachment #324059 -
Flags: superreview?(neil)
Attachment #324059 -
Flags: review?(neil)
Comment 7•17 years ago
|
||
Comment on attachment 324289 [details] [diff] [review]
don't add a listener if one already exists
>+//
>+// DetachGlobalKeyHandler
>+//
>+// Removes a key handler added by DeatchGlobalKeyHandler.
>+//
Oops ;-)
Attachment #324289 -
Flags: superreview?(neil)
Attachment #324289 -
Flags: superreview+
Attachment #324289 -
Flags: review?(neil)
Attachment #324289 -
Flags: review+
Comment 8•17 years ago
|
||
(In reply to comment #4)
> I also breakpointed in nsEventListenerManager::RemoveEventListener
> mListeners.RemoveElementAt(i); and it was only hit once.
Smaug pointed out that because the listener implements nsIDOMKeyListener it only gets added/removed once.
| Assignee | ||
Comment 9•17 years ago
|
||
minor issues with test:
- disable accesskey test, as it seems eventutils.js doesn't handle it
- make sure to close the test window when finished
| Assignee | ||
Comment 10•17 years ago
|
||
Attachment #324289 -
Attachment is obsolete: true
Attachment #325257 -
Attachment is obsolete: true
Attachment #325537 -
Flags: superreview?(neil)
Attachment #325537 -
Flags: review?(neil)
Updated•17 years ago
|
Attachment #325537 -
Flags: superreview?(neil)
Attachment #325537 -
Flags: superreview+
Attachment #325537 -
Flags: review?(neil)
Attachment #325537 -
Flags: review+
| Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 11•17 years ago
|
||
Reopening -- this was backed out, because it caused some tinderboxen to go orange due to leaks during mochitests.
Sample tinderbox log, with the offending leaks marked "ERROR FAIL":
http://tinderbox.mozilla.org/showlog.cgi?log=Mozilla2/1213882948.1213885920.16571.gz&fulltext=1
The backout was changeset 26033045ba14.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 12•17 years ago
|
||
Attachment #325537 -
Attachment is obsolete: true
Attachment #328966 -
Flags: superreview?(neil)
Attachment #328966 -
Flags: review?(neil)
Comment 13•17 years ago
|
||
Comment on attachment 328966 [details] [diff] [review]
fix the leak by readding the NS_RELEASE I had removed
>- // Release. Do this so that only the event receiver holds onto the key handler.
>+ // the reference added in NS_NewXBLWindowKeyHandler will be taken by the property
>+ if (contentNode)
>+ return contentNode->SetProperty(nsGkAtoms::listener, handler,
>+ nsPropertyTable::SupportsDtorFunc, PR_TRUE);
> NS_RELEASE(handler);
>+ return NS_OK;
>+}
You should fix up the comments to make it clearer who owns what depending on whether or not you have a content node.
Attachment #328966 -
Flags: superreview?(neil)
Attachment #328966 -
Flags: superreview+
Attachment #328966 -
Flags: review?(neil)
Attachment #328966 -
Flags: review+
| Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
| Assignee | ||
Updated•17 years ago
|
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Keywords: checkin-needed
| Assignee | ||
Updated•17 years ago
|
Flags: in-testsuite+
Updated•17 years ago
|
Keywords: dev-doc-needed
Updated•16 years ago
|
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•