Closed Bug 329337 Opened 19 years ago Closed 19 years ago

Bookmarks and "Open in Tabs" don't work in Bookmarks Menu, but do from Places Toolbar

Categories

(Firefox :: Bookmarks & History, defect, P2)

PowerPC
macOS
defect

Tracking

()

RESOLVED FIXED
Firefox 2 alpha2

People

(Reporter: fredbezies, Assigned: jaas)

References

Details

(Keywords: fixed1.8.1)

Attachments

(4 files, 4 obsolete files)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060304 Firefox/1.6a1 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060304 Firefox/1.6a1 Simple to see. Build or get a very recent nightly build. Try to use "open in tabs" from bookmarks menu Reproducible: Always Steps to Reproduce: 1.See details 2. 3. Actual Results: Nothing happens Expected Results: opening choosen bookmarks. Related to bug 329266 ?!
Assignee: nobody → annie.sullivan
Priority: -- → P2
Target Milestone: --- → Firefox 2 alpha2
Version: unspecified → Trunk
Actually, I think this bug is broader than just "Open in Tabs"... In a fresh browser window, NO bookmarks work at all from the menu in current nightlies (I'm surprised another bug hasn't been filed about that, but I can't find one). I think that issue is the same bug as the "Open in Tabs" one because they both exhibit the same peculiar behaviour... Load a page by clicking on a button in the bookmarks/places toolbar. Having done that, "Open in Tabs" will now do something. But instead of working as it's supposed to, it'll just open a new tab with the same page you just loaded. The same thing happens if you now select a bookmark from the menu... it'll just reload the previous page rather than the URL it's supposed to. Also of note, the Bookmarks Menu stopped working in the 20060304 build, which is the same build in which "Open in Tabs" reappeared on the menu (tested with fresh profile).
Summary: Open in tabs only works from Bookmark toolbar → Bookmarks and "Open in Tabs" don't work in Bookmarks Menu, but do from Places Toolbar
I can certainly confirm this bug still occurs as of the 3/9/06 build (1.6a1 daily), running under Mac OS X 10.4.5 (PPC), 2GB RAM, Dual G5 2.5 Ghz.
Attached patch incomplete fix, v0.5 (obsolete) — Splinter Review
According to Annie, we're not sending "DOMMenuItemActive" on Mac OS X when the mouse enters the rect for any given menu item. This is a partial patch, which will recieve the event we want from Carbon and track down the associated nsMenuItem. However, I have yet to write the code that goes from nsIMenuItem->nsIContent and sends the actual event. I will do that soon if nobody else wants to finish that up. This patch at least takes care of the Carbon API coding that needs to be done.
Attached patch incomplete fix, v0.8 (obsolete) — Splinter Review
This is another incomplete fix. I added an API for sending a DOM event to nsMenuItem objects. All that needs to be done is generate the DOM event we want to send in nsMenuX.cpp. I don't know how to do that, hoping somebody else can pick it up here.
*** Bug 330301 has been marked as a duplicate of this bug. ***
Attached patch fix v1.0 (obsolete) — Splinter Review
This makes Places work on Mac OS X. I only send an activate DOM event when we're over actual menu items, not separators or submenu items. Not sure if that is correct, but it works for Places and its better than what we do now, which is nothing.
Assignee: annie.sullivan → joshmoz
Attachment #214600 - Attachment is obsolete: true
Attachment #214749 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #214977 - Flags: review?(mark)
Note: fix v1.0 is against MOZILLA_1_8_BRANCH
I noticed that the patch I put up sends activate events even when the mouse goes over disabled menus. If we don't want to do that it is an easy fix.
Comment on attachment 214977 [details] [diff] [review] fix v1.0 + nsCOMPtr<nsIMenuItem> bTargetMenuItem(do_QueryInterface(aTargetMenuItem)); What's the b for? I've only seen this used for bool args, which this isn't. The code here looks OK. I'd add an out param to DispatchDOMEvent to carry the status back to the caller. Don't check in without accounting for cocoa widgets. r=me, once you resolve the behavioral stuff for disabled menu items. Nothing wrong with calling bTargetMenuItem->GetEnabled().
Attachment #214977 - Flags: review?(mark) → review+
(In reply to comment #8) > I noticed that the patch I put up sends activate events even when the mouse > goes over disabled menus. If we don't want to do that it is an easy fix. I just tested on a windows build, and the activate events do fire for disabled menu items on windows, so I think this behavior is fine.
I prefixed one target menu item pointer with "a" and the other with "b" since they are similar interfaces to the same thing. I had to come up with different names.
Attached patch fix v1.1Splinter Review
This is just like v1.0 but it includes a stub impl for Cocoa so we don't break Camino, and it also relays whether or not a handler called prevent default through the nsIMenuItem API.
Attachment #214977 - Attachment is obsolete: true
Attachment #215034 - Flags: review?(mark)
Comment on attachment 215034 [details] [diff] [review] fix v1.1 NS_METHOD -> NS_IMETHODIMP on checkin
Attachment #215034 - Flags: review?(mark) → review+
Attachment #215034 - Flags: superreview?(beng)
Comment on attachment 215034 [details] [diff] [review] fix v1.1 sr=ben@mozilla.org Land it on the trunk then request branch approval once it tests OK.
Attachment #215034 - Flags: superreview?(beng) → superreview+
fix v1.1 landed on trunk
The move to Cocoa on the trunk was very straightforward. This is exactly what we did for Carbon widgets, I'm just going to check it in.
cocoa trunk fix v1.0 checked in
Note that certain features might also rely on you firing matching DOMMenuItemInactive events.
I have to wonder -- why are we getting the docshell and prescontext if we're not using them? If we're just making sure they exist for some reason, that may be worth documenting so someone doesn't "fix" it later....
Attachment #215034 - Flags: approval-branch-1.8.1?(beng)
+ // get a pres context + nsPresContext* ourPresContext; + nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShellWeakRef); + if (!docShell) { + NS_WARNING("Failed to QI weak docshell ref to nsIDocShell"); + return NS_ERROR_FAILURE; + } + rv = MenuHelpersX::DocShellToPresContext(docShell, &ourPresContext); + if (NS_FAILED(rv)) { + NS_WARNING("Failed to get pres context from docshell"); + return NS_ERROR_FAILURE; + } Yup - this code is unnecessary. I was using it before I switched over to using nsIDOMEventTarget.
I checked in a followup fix to remove that dead code on the trunk. I'll remove it on checkin to the branch.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 215034 [details] [diff] [review] fix v1.1 >+ >+ // create DOM event >+ nsIDOMEvent* event; >+ DOMEventFactory->CreateEvent(NS_LITERAL_STRING("Events"), &event); >+ event->InitEvent(eventName, PR_TRUE, PR_TRUE); Er, why nsIDOMEvent*? It should be nsCOMPtr<nsIDOMEvent> and then DOMEventFactory->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));, otherwise you leak, right?
and please check the return value of CreateEvent. That may fail if OOM.
I'll check that out tomorrow, seems like it is the case. Thanks!
Comment on attachment 215034 [details] [diff] [review] fix v1.1 public/nsIMenuItem.h needs a new IID! and you can't land interface changes on the branch
*** Bug 330564 has been marked as a duplicate of this bug. ***
Attachment #215131 - Flags: review?(cbiesinger)
Attachment #215131 - Flags: review?(cbiesinger) → review+
fix for memory leak, iid, and CreateEvent return value checked in
Comment on attachment 215034 [details] [diff] [review] fix v1.1 You can't change interfaces like this on the branch, as biesi noted.
Attachment #215034 - Flags: approval-branch-1.8.1?(beng) → approval-branch-1.8.1-
(In reply to comment #18) >Note that certain features might also rely on you firing matching DOMMenuItemInactive events. I was thinking of the statustext code in toolkit/content/widgets/toolbar.xml but as long as you don't send a DOMMenuBarActive event you'll be OK.
Josh, are you planing to port these patches to the 1.8 branch?
Flags: blocking-firefox2?
No, so long as the Places people are able to work around the problem on the branch. I was told they had a fix for it.
At the very least, i need this for bug 333863.
Attached patch branch-friendly version (obsolete) — Splinter Review
Attachment #218395 - Flags: review?(mark)
Attachment #218395 - Flags: approval-branch-1.8.1?
Attachment #218395 - Flags: approval-branch-1.8.1? → approval-branch-1.8.1?(mark)
Blocks: 333863
Comment on attachment 218395 [details] [diff] [review] branch-friendly version >+class msIMenuItem_MOZILLA_1_8_BRANCH : public nsIMenuItem { ^ Fix that throughout, and r+a=me.
Attachment #218395 - Flags: review?(mark)
Attachment #218395 - Flags: review+
Attachment #218395 - Flags: approval-branch-1.8.1?(mark)
Attachment #218395 - Flags: approval-branch-1.8.1+
Checking in public/nsIMenuItem.h; /cvsroot/mozilla/widget/public/nsIMenuItem.h,v <-- nsIMenuItem.h new revision: 1.29.16.1; previous revision: 1.29 done Checking in src/mac/nsMenuItemX.cpp; /cvsroot/mozilla/widget/src/mac/nsMenuItemX.cpp,v <-- nsMenuItemX.cpp new revision: 1.28.12.1; previous revision: 1.28 done Checking in src/mac/nsMenuItemX.h; /cvsroot/mozilla/widget/src/mac/nsMenuItemX.h,v <-- nsMenuItemX.h new revision: 1.7.16.1; previous revision: 1.7 done Checking in src/mac/nsMenuX.cpp; /cvsroot/mozilla/widget/src/mac/nsMenuX.cpp,v <-- nsMenuX.cpp new revision: 1.57.4.1; previous revision: 1.57 done Checking in src/mac/nsMenuX.h; /cvsroot/mozilla/widget/src/mac/nsMenuX.h,v <-- nsMenuX.h new revision: 1.14.12.1; previous revision: 1.14 done
Attachment #218395 - Attachment is obsolete: true
Flags: blocking-firefox2?
Keywords: fixed1.8.1
*** Bug 330932 has been marked as a duplicate of this bug. ***
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h". In Thunderbird 3.0b, you do that as follows: Tools | Message Filters Make sure the correct account is selected. Click "New" Conditions: Body contains places-to-b-and-h Change the action to "Delete Message". Select "Manually Run" from the dropdown at the top. Click OK. Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter. Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: