Closed
Bug 416564
Opened 16 years ago
Closed 16 years ago
ctrl-z on any xul page results in bookmarks JS exception "aTarget is null" in onDragRemoveFeedBack
Categories
(SeaMonkey :: Bookmarks & History, defect)
SeaMonkey
Bookmarks & History
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ajschult784, Assigned: neil)
References
()
Details
Attachments
(1 file, 1 obsolete file)
651 bytes,
patch
|
ajschult784
:
review+
|
Details | Diff | Splinter Review |
Any any xul page (the URL field is an empty xul page), hitting ctrl-z results in: [Exception... "'[JavaScript Error: "aTarget is null" {file: "chrome://communicator/content/bookmarks/bookmarksMenu.js" line: 707}]' when calling method: [nsIController::doCommand]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "<unknown>" data: yes] onDragRemoveFeedback is being called from BookmarksMenuController.doCommand, where aCommand is cmd_undo. This bug means we'll throw the exception once bug 416561 lands, although the test will still pass.
Assignee | ||
Comment 1•16 years ago
|
||
Seems that the caller is expected to null-check.
Reporter | ||
Comment 2•16 years ago
|
||
OK, I'm going to ask a dumb question... Why does navigator.js do |controllers.appendController(BookmarksMenuController);| in the first place? It's not what handles ctrl-D or ctrl-B. If you do some bookmarks thing (copy/paste, delete, etc), and hit ctrl-Z (while focused on the content area), it doesn't undo it, even if you did the action from the bookmarks menu. I commented on that line, and I don't see any adverse effects... OK, I thought maybe the sidebar needed that, but undo works there without the BookmarksMenuController. It seems to do a lot of drag/drog stuff, but that seems to work fine without it as well (dragging a link into the menu works OK).
Assignee | ||
Comment 3•16 years ago
|
||
The context menu needs it e.g. the properties menuitem's command attribute of cmd_bm_properties relates to a command element of that id whose oncommand event handler calls goDoCommand which looks up the command in the controllers.
Reporter | ||
Comment 4•16 years ago
|
||
Hmm. OK, that makes sense, but the context menu items (Bookmark this {Link,Page} still work in a build with the appendController line commented out. Is that what it's there for?
Assignee | ||
Comment 5•16 years ago
|
||
(In reply to comment #4) >Hmm. OK, that makes sense, but the context menu items (Bookmark this >{Link,Page} still work in a build with the appendController line commented out. Sorry, I meant the context menu for a bookmark needs the controller.
Reporter | ||
Comment 6•16 years ago
|
||
right! OK, I guess the fact that this stuff is getting called when I'm just messing with the content area is a bit disturbing. Even with the patch, we're still calling into the bookmark undo code (which (thank goodness) doesn't find anything to undo). Can we do: if (!document.popupNode) return; ?
Assignee | ||
Comment 7•16 years ago
|
||
Navigator isn't the only window that uses the bookmarks controller...
Reporter | ||
Comment 8•16 years ago
|
||
http://mxr.mozilla.org/seamonkey/search?string=BookmarksMenuController only finds navigator. And I can't think of any other window that has bookmarks in the menu.
Assignee | ||
Comment 9•16 years ago
|
||
Oh right, the tree has its own controller.
Assignee | ||
Comment 10•16 years ago
|
||
OK, so it looks like destroyContextMenu does the honours anyway...
Attachment #302582 -
Attachment is obsolete: true
Attachment #303537 -
Flags: review?(ajschult)
Attachment #302582 -
Flags: review?(ajschult)
Reporter | ||
Updated•16 years ago
|
Attachment #303537 -
Flags: review?(ajschult) → review+
Assignee | ||
Comment 12•16 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•