Closed Bug 345075 Opened 18 years ago Closed 18 years ago

Focus inconsistency when closing tab opened by 'Search <selected engine> for <selected text>'

Categories

(Firefox :: Tabbed Browser, defect, P1)

2.0 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 2 beta2

People

(Reporter: tommyjb, Assigned: Gavin)

References

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060714 BonEcho/2.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060714 BonEcho/2.0b1

1. Ensure that 'Select new tabs opened from links' is disabled.
2. Open a page containing text (for example: <http://www.mozilla.com/firefox/>).
3. Open a new blank tab (to the right of the tab-containing-text).
4. Focus the tab-containing-text.

5. Select some text.
6. Right-click and select 'Search <selected engine> for <selected text>'.

7. Focus the tab spawned in the step 6.
8. Close this (current) tab.

I'm now automatically switched back to the tab created in step 2 (the tab containing text).  However, if one substitutes step 6 with

    6 (new): Middle-click a link on the page.

then the tab created in step 3 (the blank tab) is the one that's automatically focused after following step 8.

Reproducible in Bon Echo and Minefield 14th July builds.

Reproducible: Always
In what does this differ from Bug 345033?
That's about [background tabs opened by middle-clicking links] not focusing the parent tab on closing.  This is about [background tabs opened from 'search for selected text'] focusing the parent tab on closing when apparently they shouldn't be.
This has been decided and changed in Bug 308396 I guess. The thought behind this might be that the search is a temporary other task. You have the intention to return to this page when you're done with the search.
And when you follow a link on the page you have the intension to navigate away permanently. 
I've set this as blocking 345028, since this behaviour could easily cause confusion, given that it doesn't follow the "when closing a tab, focus the parent tab (specifically) ONLY IF the tab being closed was opened with focus" rule.
Blocks: 345028
Note that, in this context, focus is switched back to the parent tab (when the child tab is closed) EVEN IF the user switched to other tabs before switching to the child tab.
I think this really needs looking at.  This can be very confusing.  To illustrate my point in comment 5, imagine the following scenario:

1. You have two tabs open (tab 1 and tab 2), and you're currently viewing tab 1.
2. You select some text and use 'Search <engine> for <text>', causing search results to open in a new background tab (tab 3).
3. You continue reading tab 1 for a while, and then you switch focus to tab 2.
4. After reading tab 2 for a while, you switch focus to tab 3 (search results).
5. You close tab 3 and you're then switched back to tab 1, not tab 2!
Flags: blocking-firefox2?
plussing like the rest, not sure why the owner is set, this might be a regression from something else.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-firefox2? → blocking-firefox2+
Attached patch patchSplinter Review
The problem is that loadSearch is the only caller that passes "null" for "aLoadInBackground", which means "use the pref". Unfortunately the check for whether we should use an owner happens before we've actually determined whether we're loading in the background.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #230457 - Flags: review?(mconnor)
Priority: -- → P1
Hardware: PC → All
Whiteboard: [patch-r?][needs review mconnor]
Target Milestone: --- → Firefox 2 beta2
Version: unspecified → 2.0 Branch
Attachment #230457 - Flags: review?(mconnor) → review+
mozilla/toolkit/content/widgets/tabbrowser.xml 	1.175
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [patch-r?][needs review mconnor] → [need-a]
Comment on attachment 230457 [details] [diff] [review]
patch

This is a simple, well understood patch that affects only the single case that it fixes, so it carries a low risk of causing a regression.
Attachment #230457 - Flags: approval1.8.1?
Comment on attachment 230457 [details] [diff] [review]
patch

a=drivers. Please land on the MOZILLA_1_8_BRANCH.
Attachment #230457 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [need-a] → [checkin needed (1.8 branch)]
mozilla/toolkit/content/widgets/tabbrowser.xml 	1.103.2.64
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: