Closed
Bug 206668
Opened 22 years ago
Closed 22 years ago
[Mac OS X classic theme] context menu only work on frontmost tab, additional tabs opening
Categories
(Core Graveyard :: Skinability, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: bugzilla, Assigned: shliang)
References
Details
(Keywords: platform-parity, regression, Whiteboard: [adt2][verified on trunk, see comment 22])
Attachments
(1 file, 3 obsolete files)
2.85 KB,
patch
|
neil
:
review+
jag+mozilla
:
superreview+
asa
:
approval1.4+
|
Details | Diff | Splinter Review |
found using jag's test build for bug 203960 on Mac OS X (10.2.6). specific to
the classic theme, not a problem on modern.
1. have multiple tabs open.
2. bring up the context menu for the tab bar over one of the background tabs.
3. select either "close tab" or "close other tabs".
expected: if "close tab" is selected, the background tab should close. if "close
other tabs", then all other tabs except the background one (where the pointer
was over) should close.
actual results: regardless of where the mouse pointer is, the frontmost tab is
closed when "close tab" is selected, or remains the only one open when "close
other tabs" is selected.
Reporter | ||
Updated•22 years ago
|
QA Contact: pmac → gbush
Comment 1•22 years ago
|
||
*** Bug 206524 has been marked as a duplicate of this bug. ***
Comment 2•22 years ago
|
||
Seems like a regression from bug 192029.
Reporter | ||
Comment 3•22 years ago
|
||
found another case where this (classic-only bug) occurs, so making the summary
more general.
1. have a group tabs open, eg, containing 3 tabs.
2. make sure the 1st tab is the frontmost one, and that 2nd and 3rd remain in
background.
3. do any of the following:
* from the 1st tab, drag a link onto either the 2nd or 3rd tab.
* drag a bookmark from the PT onto either the 2nd or 3rd tab.
* drag the proxy icon from the urlbar onto either the 2nd or 3rd tab.
expected: that link/url should load in that background tab.
actual results: a new tab is added, loading that link/url. (not a problem with
today's verification build.)
Severity: normal → major
Summary: OS X classic theme: "close tab" and "close other tabs" only work on frontmost tab → classic theme: context menu only work on frontmost tab, additional tabs opening
Comment 4•22 years ago
|
||
adt: nsbeta1+/adt2
Attachment #124301 -
Flags: review?(jaggernaut)
Comment 6•22 years ago
|
||
Comment on attachment 124301 [details] [diff] [review]
patch
>Index: tabbrowser.xml
>===================================================================
>@@ -955,10 +967,17 @@
> var bgLoad = this.mPrefs.getBoolPref("browser.tabs.loadInBackground");
>
> if (aEvent.target.localName == "tabs") {
>- // We're adding a new tab.
>- var tab = this.addTab(getShortcutOrURI(url));
>- if (!bgLoad)
>- this.selectedTab = tab;
>+ if (aEvent.originalTarget.localName == "tab") {
>+ this.getBrowserForTab(aEvent.originalTarget).loadURI(getShortcutOrURI(url));
>+ if (!bgLoad)
>+ this.selectedTab = aEvent.originalTarget;
>+ }
>+ else {
>+ // We're adding a new tab.
>+ var tab = this.addTab(getShortcutOrURI(url));
>+ if (!bgLoad)
>+ this.selectedTab = tab;
>+ }
> }
> else if (aEvent.target.localName == "tab") {
> // Load in an existing tab.
You're duplicating the code here for loading the URI into an existing tab. One
way around this is something like this:
var tab;
if (aEvent.target.localName == "tabs" &&
aEvent.originalTarget.localName != "tab") {
// We're adding a new tab.
tab = this.addTab(getShortcutOrURI(url));
if (!bgLoad)
this.selectedTab = tab;
}
else if ((tab = aEvent.target).localName == "tab" ||
(tab = aEvent.originalTarget).localName == "tab") {
// Load in an existing tab.
this.getBrowserForTab(tab).loadURI(getShortcutOrURI(url));
if (!bgLoad && this.mCurrentTab != tab)
this.selectedTab = tab;
}
Though I'm wondering if this would suffice (should, but not sure, needs
testing):
var tab = null;
if (aEvent.originalTarget.localName == "tabs") {
// We're adding a new tab.
tab = this.addTab(getShortcutOrURI(url));
}
else if (aEvent.originalTarget.localName == "tab") {
// Load in an existing tab.
tab = aEvent.originalTarget;
this.getBrowserForTab(tab).loadURI(getShortcutOrURI(url));
}
if (tab && !bgLoad && this.mCurrentTab != tab)
this.selectedTab = tab;
Regardless, this patch is a hack around a problem in the retargetting code. I
might sr this for the branch as a last minute fix if we can't come up with the
real fix in time.
Attachment #124301 -
Flags: review?(jaggernaut) → review-
Comment 7•22 years ago
|
||
So this is more event retargeting fallout? :-( No wonder I can't duplicate the
bug, I still have a fix in my tree from the last bug (menulist selection). In
that case the workaround was to use event.originalTarget instead of event.target
so I agree with jag's comment there. Is the document.popupNode problem also
caused by event retargeting?
Comment 8•22 years ago
|
||
Whoops, should read the OS more carefully :-[
Comment 9•22 years ago
|
||
Reporter | ||
Updated•22 years ago
|
Flags: blocking1.4?
Keywords: pp
Summary: classic theme: context menu only work on frontmost tab, additional tabs opening → [Mac OS X classic theme] context menu only work on frontmost tab, additional tabs opening
Assignee | ||
Comment 10•22 years ago
|
||
Attachment #124301 -
Attachment is obsolete: true
Attachment #125469 -
Flags: superreview?(jaggernaut)
Attachment #125469 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Comment 11•22 years ago
|
||
Attachment #125469 -
Attachment is obsolete: true
Attachment #125469 -
Flags: superreview?(jaggernaut)
Attachment #125469 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 12•22 years ago
|
||
Comment on attachment 125480 [details] [diff] [review]
cleaned up more patch
sr=jag for 1.4 branch
Attachment #125480 -
Flags: superreview+
Comment 13•22 years ago
|
||
Comment on attachment 125480 [details] [diff] [review]
cleaned up more patch
a=asa (on behalf of drivers) for checkin to the 1.4 branch.
Attachment #125480 -
Flags: approval1.4+
Comment 14•22 years ago
|
||
This actually seems to be a bug in the event retargetting code.
Here's the problem:
<content>
<hbox>
<children/>
</hbox>
</content>
Say the above represents the basic structure of <tabs/>, which in our code we
use like this:
<tabs>
<tab/>
<tab/>
...
</tabs>
From the point of view of <tabs/>, an event on <tab/> should have
event.target.localName == "tab".
With this change:
<content>
<hbox>
<hbox>
<children/>
</hbox>
</hbox>
</content>
an event on <tab/> now gets us event.target.localName == "tabs"
Ain't that odd?
Now, for 1.4 the above is what we've come up with, but for the trunk we should
fix the above problem.
Comment 15•22 years ago
|
||
Comment on attachment 125480 [details] [diff] [review]
cleaned up more patch
Sorry, will have to minus this. There's no guarantee
document.popupNode.localName is set before the onmousedown handler in
tabbrowser gets called (in fact, I just tested for that and it was null,
resulting in the first context menu "Close Tab" to fail). I think this could be
fixed by just dropping that part of the if check, but will defer to Shuehan.
Attachment #125480 -
Flags: superreview+ → superreview-
Updated•22 years ago
|
Attachment #125480 -
Flags: approval1.4+
Comment 16•22 years ago
|
||
event.originalTarget should be reliable, because the tab's boxObject will ensure
that the event was originally targetted at itself and not at its content.
I guess that the problem is the same as the modern menulist problem (bug 196755)
- for which I believe my attachment 117071 [details] [diff] [review] is still usable.
Assignee | ||
Comment 17•22 years ago
|
||
Attachment #125480 -
Attachment is obsolete: true
Attachment #125517 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #125517 -
Flags: review?(jaggernaut)
Updated•22 years ago
|
Attachment #125517 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #125517 -
Flags: superreview+
Attachment #125517 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #125517 -
Flags: review?(jaggernaut)
Comment 18•22 years ago
|
||
*** Bug 209008 has been marked as a duplicate of this bug. ***
Comment 19•22 years ago
|
||
Comment on attachment 125517 [details] [diff] [review]
patch
Looks good, and doesn't break anything on Linux.
Attachment #125517 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Comment 20•22 years ago
|
||
+ if (this.mCurrentTab != tab && !bgLoad)
I fixed this spacing when checking in ^^
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 21•22 years ago
|
||
Sarah,
Will you check this? I am able to reproduce exactly what you reported-wrong
tabs get closed per steps in your first comment - and steps in comment #3
thx
Reporter | ||
Comment 22•22 years ago
|
||
tested using 2003.06.13.08-trunk (commercial) bits, OS X 10.2.6, classic theme.
comment 0: i was able to repro this problem *only once*, during the first
session of the build. during that first session, and on subsequent sessions, it
was *no longer* a problem.
comment 3: these worked fine (unable to repro).
i'd say that this is prolly good enough for now (esp the branch, if/when it
lands there).
Grace, are you able to repro the problems consistently/frequently?
Whiteboard: [adt2] → [adt2][verified on trunk, see comment 22]
Comment 23•22 years ago
|
||
thanks Sarah,
I tested on today's branch- just retested on trunk and all is well- could not
reproduce any problems!
Comment 24•22 years ago
|
||
a=adt to land this on the 1.4 branch. Please add the fixed1.4 keyword once you
land this.
Comment 25•22 years ago
|
||
It appears that the patch for this bug was backed out. Removing fixed1.4 keyword.
Please don't land unless you get explicit approval from drivers and adt again.
Thanks.
Keywords: fixed1.4
Comment 26•22 years ago
|
||
Comment on attachment 125517 [details] [diff] [review]
patch
a=asa (on behalf of drivers) for checkin to the 1.4 branch.
Attachment #125517 -
Flags: approval1.4+
Comment 27•22 years ago
|
||
a=adt to land this on the 1.4 branch by tonight (before 2003-06-19 5am and no
later please). Please mark this with the fixed1.4 keyword once this lands.
Thanks.
Reporter | ||
Updated•22 years ago
|
QA Contact: gbush → sairuh
Comment 29•22 years ago
|
||
verified on branch build 20030619
Status: RESOLVED → VERIFIED
Keywords: fixed1.4 → verified1.4
Comment 30•22 years ago
|
||
*** Bug 207758 has been marked as a duplicate of this bug. ***
Comment 32•21 years ago
|
||
I really wonder why you need both onclick=..." and onmousedown="..." set on
<tabs> This small patch should work on all platforms:
-this.mContextTab = document.popupNode;
+this.mContextTab = (aEvent.originalTarget.localName == "tab") ?
eEvent.originalTarget : document.popupNode;
You don't need onmousedown and that method in tabbrowser.xml
Comment 33•21 years ago
|
||
HJ, I can't tell where your patch is supposed to apply; updatePopupMenu doesn't
have access to an appropriate event, which is why onmousedown was used (although
oncontextmenu would have worked just as well, I since realized).
Of course if the XBL bug was fixed we could ditch this hack.
Comment 34•21 years ago
|
||
I would say remove this line:
onmousedown="this.parentNode.parentNode.parentNode.updateContextTab(event);"
and the corresponding method. onclick has that event and it exactly what should
be used, at least that is how I look at this. After all, you clicked on the tab,
right? You could add a single line like this to method 'onTabClick':
this.mContextTab = (aEvent.originalTarget.localName == "tab") ?
aEvent.originalTarget : document.popupNode;
to replace method updateContextTab. This will prevent the XBL, in case it still
happens, but doesn't break backward compatibility, because that is exactly what
adding new methods does. Well, in case you're an add-on like MultiZilla.
onmousedown and onclick are almost the same things, so why not use just one of them?
Another way of solving this is to replace 'this' with 'event' for pdatePopupMenu
and to add the line in that method and to replace 'aPopupMenu' with
'this.mContextTab'
Comment 35•21 years ago
|
||
> onmousedown and onclick are almost the same things, so why not
> use just one of them?
On some platforms the context menu event is triggered by the right
mouse button down event, not by the right mouse button click event.
> Another way of solving this is to replace 'this' with 'event' for
> updatePopupMenu and to add the line in that method and to replace
> 'aPopupMenu' with 'this.mContextTab'
Except the event target for updatePopupMenu is the menupopup...
Comment 36•21 years ago
|
||
"Except the event target for updatePopupMenu is the menupopup..."
So I noticed. I now know what I was looking for, thanks Neil :-)
Updated•17 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•