Closed
Bug 348369
Opened 18 years ago
Closed 18 years ago
Tabbrowser steals focus any time the current browser changes
Categories
(Toolkit :: UI Widgets, defect, P3)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: asaf)
References
()
Details
Attachments
(1 file, 1 obsolete file)
2.51 KB,
patch
|
Gavin
:
first-review+
|
Details | Diff | Splinter Review |
STEPS TO REPRODUCE: 1) Start Firefox. 2) Set browser.tabs.loadDivertedInBackground to false. 3) Set browser.link.open_newwindow to 3. 4) Set browser.link.open_newwindow.restriction to 0. 5) Disable the popup blocker. 6) Run the javascript: URL in this URL field. 7) Focus some other app. 8) Wait 5 seconds. ACTUAL RESULTS: Other app loses focus, Firefox gets it EXPECTED RESULTS: Do not steal focus! DETAILS: The window.focus() call happens from 2 setFocus(element = [object XPCNativeWrapper [object Window @ 0x8291c40 (native @ 0x94e3f24)]], 98) ["chrome://global/content/bindings/tabbrowser.xml":766] We should probably just shift focus around without actually calling window.focus if we're not the active window. NOTE: This makes running automated tests that include window.open() pretty painful.
Assignee | ||
Comment 1•18 years ago
|
||
Stolen from bug 232605.
Assignee: nobody → mano
Status: NEW → ASSIGNED
Attachment #243897 -
Flags: first-review?(gavin.sharp)
Comment 2•18 years ago
|
||
Comment on attachment 243897 [details] [diff] [review] patch >Index: toolkit/content/widgets/tabbrowser.xml >- function setFocus(element) { >- document.commandDispatcher.suppressFocusScroll = true; >- try { >- element.focus(); >+ nit: remove one of the blank lines here. >+ if (aElement instanceof Window) { >+ cmdDispatcher.focusedWindow = aElement; >+ cmdDispatcher.focusedElement = null; >+ } >+ else { >+ cmdDispatcher.focusedWindow = null; >+ cmdDispatcher.focusedElement = aElement; >+ } Why did you change it to use null for the focusedWindow in the second case?
Comment 3•18 years ago
|
||
Comment on attachment 243897 [details] [diff] [review] patch Just moving this out of my queue until comment 2 is answered.
Attachment #243897 -
Flags: first-review?(gavin.sharp) → first-review-
Assignee | ||
Comment 4•18 years ago
|
||
I shouldn't have.
Assignee | ||
Comment 5•18 years ago
|
||
Attachment #243897 -
Attachment is obsolete: true
Attachment #244662 -
Flags: first-review?(gavin.sharp)
Comment 6•18 years ago
|
||
Comment on attachment 244662 [details] [diff] [review] patch I wasn't not able to test this, but r=me assuming you did.
Attachment #244662 -
Flags: first-review?(gavin.sharp) → first-review+
Assignee | ||
Comment 7•18 years ago
|
||
mozilla/toolkit/content/widgets/tabbrowser.xml 1.214
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
OS: Linux → All
Priority: -- → P3
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha1
Comment 8•18 years ago
|
||
Could this bug have caused bug 360714?
Comment 9•18 years ago
|
||
(In reply to comment #8) > Could this bug have caused bug 360714? Pretty unlikely I think. Bug 130078 is more likely the cause of that regression, in my opinion.
Comment 10•18 years ago
|
||
I don't know how we'd unit-test this, but I think we should find a way to do so.
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•