window.focus() in a background tab can steal focus from foreground tab

VERIFIED FIXED in mozilla1.8rc1

Status

VERIFIED FIXED
13 years ago
7 years ago

People

(Reporter: martijn.martijn, Assigned: jst)

Tracking

(Depends on: 1 bug, {testcase, verified1.8})

Trunk
mozilla1.8rc1
testcase, verified1.8
Dependency tree / graph
Bug Flags:
blocking1.8b5 -
blocking1.8rc1 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sg:fix][HAVE FIX])

Attachments

(2 attachments)

(Reporter)

Description

13 years ago
See upcoming testcase. It uses almost the same code as in bug 299677, but now
window.focus() is used, which still successfully can steal focus from another tab.
(Reporter)

Comment 1

13 years ago
Created attachment 198224 [details]
testcase

Comment 2

13 years ago
Confirmed using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1)
Gecko/20051003 Firefox/1.6a1.
Flags: blocking1.8b5?
Whiteboard: [sg:fix]

Comment 3

13 years ago
Martijn, can you get a patch together tonight? jst, if you get cycles, can you
help here?

Comment 4

13 years ago
*** Bug 272867 has been marked as a duplicate of this bug. ***

Comment 5

13 years ago
Johnny, can you dig into this for us?
Assignee: nobody → jst

Comment 6

13 years ago
rc1 blocker.
Flags: blocking1.8rc1+
Flags: blocking1.8b5?
Flags: blocking1.8b5-

Comment 7

13 years ago
Also see the same thing as the testcase in branch.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051012
Firefox/1.4.1 ID:2005101205


Comment 8

13 years ago
*** Bug 312311 has been marked as a duplicate of this bug. ***

Comment 9

13 years ago
is this a dupe of bug 306245?
(Assignee)

Comment 10

13 years ago
Created attachment 199614 [details] [diff] [review]
Fix to ignore focus calls on a hidden tab.

This fixes this problem pretty much in the same way we "fixed" bug 124750.
Attachment #199614 - Flags: superreview?(dveditz)
Attachment #199614 - Flags: review?(mrbkap)
(Assignee)

Updated

13 years ago
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [sg:fix] → [sg:fix][HAVE FIX]
Target Milestone: --- → mozilla1.8rc1
Comment on attachment 199614 [details] [diff] [review]
Fix to ignore focus calls on a hidden tab.

r=mrbkap
Attachment #199614 - Flags: review?(mrbkap) → review+
Comment on attachment 199614 [details] [diff] [review]
Fix to ignore focus calls on a hidden tab.

sr=dveditz
Attachment #199614 - Flags: superreview?(dveditz) → superreview+
doesn't this break window.focus() on a minimized window?

Updated

13 years ago
Attachment #199614 - Flags: approval1.8rc1?

Comment 14

13 years ago
Johnny, can you respond to Asaf's question? Time is running out for this release
and we need this to land ASAP.

Comment 15

13 years ago
(In reply to comment #7)
> Also see the same thing as the testcase in branch.
> 
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051012
> Firefox/1.4.1 ID:2005101205
> 
> 
> 

Can someone change version field to something to include trunk and branch?
(Assignee)

Comment 16

13 years ago
(In reply to comment #13)
> doesn't this break window.focus() on a minimized window?

I just tested that and a minimized window is still brought back into focus with
this patch applied. So no, this doesn't break that. Landed on the trunk now.
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

13 years ago
Keywords: qawanted

Updated

13 years ago
Attachment #199614 - Flags: approval1.8rc1? → approval1.8rc1+

Comment 17

13 years ago
jst checked this into MOZILLA_1_8_BRANCH at 2005-10-18 16:27.
Keywords: fixed1.8

Comment 18

13 years ago
v.fixed on both trunk (Linux 20051020) and branch (Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051020 Firefox/1.5) using the
testcase... tab doesn't steal focus/input.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8 → verified1.8

Updated

13 years ago
Keywords: qawanted
*** Bug 321586 has been marked as a duplicate of this bug. ***

Updated

11 years ago
Depends on: 416771
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.