Closed
Bug 343096
Opened 18 years ago
Closed 18 years ago
Dispatch TabSelect event for tabbrowser-tabs only
Categories
(Toolkit :: XUL Widgets, defect)
Toolkit
XUL Widgets
Tracking
()
RESOLVED
FIXED
People
(Reporter: asaf, Assigned: csthomas)
References
Details
(Keywords: fixed1.8.1)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
asaf
:
first-review+
mconnor
:
approval1.8.1+
|
Details | Diff | Splinter Review |
See comments from Neil in bug 318168 and bug 322898.
If we do keep the TabSelect for the tabbox bindings, we should also dispatch TabOpen and TabClose events on them (note tabbox has support for adding and removing tabs in its API).
Reporter | ||
Updated•18 years ago
|
Flags: blocking-firefox2?
Comment 1•18 years ago
|
||
I don't think this blocks, it'd be nice to settle on an answer though. (Note that the tabbox select event didn't bubble in 1.5, that's a new change.)
Flags: blocking-firefox2? → blocking-firefox2-
Updated•18 years ago
|
Summary: Dispatch TabSelect for tabbrowser-tabs only → Dispatch TabSelect event for tabbrowser-tabs only
Comment 2•18 years ago
|
||
(In reply to comment #1)
>I don't think this blocks, it'd be nice to settle on an answer though. (Note
>that the tabbox select event didn't bubble in 1.5, that's a new change.)
IIRC it did because XUL elements used to ignore the canBubble flag.
Assignee | ||
Comment 3•18 years ago
|
||
attaching to the right bug...
Assignee | ||
Comment 4•18 years ago
|
||
Neil pointed out that the event should be dispatched from the tab, which the previous patch did not do.
Attachment #228464 -
Attachment is obsolete: true
Attachment #228485 -
Flags: first-review?(bugs.mano)
Attachment #228464 -
Flags: first-review?(bugs.mano)
Reporter | ||
Comment 5•18 years ago
|
||
Comment on attachment 228485 [details] [diff] [review]
better patch
updateCurrentBrowser is also called from removeTab (i didn't check why), and is also a pseudo-api here, I don't think we should let callers accidentally dispatch this event.
Attachment #228485 -
Flags: first-review?(bugs.mano) → first-review-
Comment 6•18 years ago
|
||
(In reply to comment #5)
>I don't think we should let callers accidentally dispatch this event.
I think that the TabSelect event should be dispatched however the tab is changed, and not just through user input, for which the select event suffices.
Assignee | ||
Comment 7•18 years ago
|
||
(In reply to comment #5)
> (From update of attachment 228485 [details] [diff] [review] [edit])
> updateCurrentBrowser is also called from removeTab (i didn't check why), and is
> also a pseudo-api here, I don't think we should let callers accidentally
> dispatch this event.
>
Mano, does Neil's comments affect your thoughts?
Reporter | ||
Comment 8•18 years ago
|
||
(In reply to comment #6)
> (In reply to comment #5)
> >I don't think we should let callers accidentally dispatch this event.
> I think that the TabSelect event should be dispatched however the tab is
> changed, and not just through user input, for which the select event suffices.
>
I'm not sure what "user input" and "tah is changed" mean here. In which case, "select" isn't dispatched? Why should TabSelect be dispatched in that case?
Assignee | ||
Comment 9•18 years ago
|
||
(In reply to comment #8)
> (In reply to comment #6)
> > (In reply to comment #5)
> > >I don't think we should let callers accidentally dispatch this event.
> > I think that the TabSelect event should be dispatched however the tab is
> > changed, and not just through user input, for which the select event suffices.
> >
>
> I'm not sure what "user input" and "tah is changed" mean here. In which case,
> "select" isn't dispatched? Why should TabSelect be dispatched in that case?
>
You close the current tab. As a result, a different tab gets selected. People who care about tab switches probably care about that indirectly-caused current-tab change as well as ones caused by normal methods (e.g. clicking a different tab), so dispatching the TabSelect is a good thing.
Reporter | ||
Comment 10•18 years ago
|
||
(In reply to comment #9)
> >
> > I'm not sure what "user input" and "tah is changed" mean here. In which case,
> > "select" isn't dispatched? Why should TabSelect be dispatched in that case?
> >
>
> You close the current tab. As a result, a different tab gets selected. People
> who care about tab switches probably care about that indirectly-caused
> current-tab.
Are we sure "select" isn't dispatched in that case? I know the comment says so, but...
Comment 11•18 years ago
|
||
Well without auditing the code I guess there are four possibilities:
1) select events exactly match tab changes. This means that moving the TabSelect notification into tabbrowser will have no effect.
2) some tab changes don't generate select events, which is why removeTab calls updateCurrentBrowser
3) some tab changes generate duplicate select events, which is why updateCurrentBrowser checks that the browser isn't already current first
4) both 2) and 3)
In the latter cases, moving the TabSelect notification into tabbrowser will make it more reliable and useful. Either way you can't lose :-)
Reporter | ||
Comment 12•18 years ago
|
||
Comment on attachment 228485 [details] [diff] [review]
better patch
OK, this will do for now. I would really like to see this on the branch before extensions start relying on the new tabbox event.
Please file a bug on cleaning up the removeTab mess.
Attachment #228485 -
Flags: first-review-
Attachment #228485 -
Flags: first-review+
Attachment #228485 -
Flags: approval1.8.1?
Comment 13•18 years ago
|
||
Comment on attachment 228485 [details] [diff] [review]
better patch
a=mconnor on behalf of drivers for 1.8 branch
Attachment #228485 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Comment 14•18 years ago
|
||
Checked in on trunk and branch.
Filed bug 351106 on the removeTab stuff.
No longer blocks: 351106
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•