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)
Tracking
()
RESOLVED
FIXED
Firefox 2 alpha2
People
(Reporter: fredbezies, Assigned: jaas)
References
Details
(Keywords: fixed1.8.1)
Attachments
(4 files, 4 obsolete files)
10.39 KB,
patch
|
mark
:
review+
bugs
:
superreview+
mconnor
:
approval-branch-1.8.1-
|
Details | Diff | Splinter Review |
4.87 KB,
patch
|
Details | Diff | Splinter Review | |
3.16 KB,
patch
|
Biesinger
:
review+
|
Details | Diff | Splinter Review |
8.86 KB,
patch
|
Details | Diff | Splinter Review |
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 ?!
Updated•19 years ago
|
Assignee: nobody → annie.sullivan
Priority: -- → P2
Target Milestone: --- → Firefox 2 alpha2
Reporter | ||
Updated•19 years ago
|
Version: unspecified → Trunk
Comment 1•19 years ago
|
||
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
Comment 2•19 years ago
|
||
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.
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.
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.
Comment 5•19 years ago
|
||
*** Bug 330301 has been marked as a duplicate of this bug. ***
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)
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 9•19 years ago
|
||
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+
Comment 10•19 years ago
|
||
(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.
Assignee | ||
Comment 11•19 years ago
|
||
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.
Assignee | ||
Comment 12•19 years ago
|
||
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 13•19 years ago
|
||
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 14•19 years ago
|
||
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+
Assignee | ||
Comment 15•19 years ago
|
||
fix v1.1 landed on trunk
Assignee | ||
Comment 16•19 years ago
|
||
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.
Assignee | ||
Comment 17•19 years ago
|
||
cocoa trunk fix v1.0 checked in
Comment 18•19 years ago
|
||
Note that certain features might also rely on you firing matching DOMMenuItemInactive events.
Comment 19•19 years ago
|
||
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)
Assignee | ||
Comment 20•19 years ago
|
||
+ // 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.
Assignee | ||
Comment 21•19 years ago
|
||
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 22•19 years ago
|
||
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?
Comment 23•19 years ago
|
||
and please check the return value of CreateEvent. That may fail if OOM.
Assignee | ||
Comment 24•19 years ago
|
||
I'll check that out tomorrow, seems like it is the case. Thanks!
Comment 25•19 years ago
|
||
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
Comment 26•19 years ago
|
||
*** Bug 330564 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 27•19 years ago
|
||
Attachment #215131 -
Flags: review?(cbiesinger)
Updated•19 years ago
|
Attachment #215131 -
Flags: review?(cbiesinger) → review+
Assignee | ||
Comment 28•19 years ago
|
||
fix for memory leak, iid, and CreateEvent return value checked in
Comment 29•19 years ago
|
||
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-
Comment 30•19 years ago
|
||
(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.
Comment 31•19 years ago
|
||
Josh, are you planing to port these patches to the 1.8 branch?
Flags: blocking-firefox2?
Assignee | ||
Comment 32•19 years ago
|
||
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.
Comment 33•19 years ago
|
||
At the very least, i need this for bug 333863.
Comment 34•19 years ago
|
||
Attachment #218395 -
Flags: review?(mark)
Attachment #218395 -
Flags: approval-branch-1.8.1?
Updated•19 years ago
|
Attachment #218395 -
Flags: approval-branch-1.8.1? → approval-branch-1.8.1?(mark)
Comment 35•19 years ago
|
||
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+
Comment 36•19 years ago
|
||
Comment on attachment 218395 [details] [diff] [review]
branch-friendly version
Also, you can remove some unnecessary code here as was done on the trunk:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsMenuItemX.cpp&branch=&root=/cvsroot&subdir=mozilla/widget/src/mac&command=DIFF_FRAMESET&rev1=1.31&rev2=1.32
Comment 37•19 years ago
|
||
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
Updated•19 years ago
|
Flags: blocking-firefox2?
Keywords: fixed1.8.1
Comment 38•19 years ago
|
||
*** Bug 330932 has been marked as a duplicate of this bug. ***
Comment 39•15 years ago
|
||
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.
Description
•