Open Bug 284651 Opened 20 years ago Updated 2 years ago

loss of focus if tab is deselected before initial reflow

Categories

(Firefox :: Tabbed Browser, defect, P5)

defect

Tracking

()

People

(Reporter: bryner, Unassigned)

References

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

It's possible that this bug is filed already.  I couldn't find it though, and I
wanted to get this in while the steps are still fresh in my mind:

1. Make sure prefs are set to select tabs opened from history
2. Open history sidebar
3. Middle-click a link to open it in a new tab
4. _Immediately_ switch away from the just-opened tab.  You must switch away
while the content area is still gray, before the page background is painted.
5. Wait for the new page to finish loading (watch the load indicator in the tab)
6. Switch back to the new page
7. Try to scroll using arrows, tab, etc -- doesn't work
This bug is still present in Firefox 1.5.0.6 and 2.0b1. I noticed a slightly different approach for triggering the bug:

1. Go to http://www.google.com
2. Open a new tab and go to some slow site, e.g. http://sourceforge.net
3. Click a link and immediately switch to the first tab
4. Wait until 'Loading...' disappears on the second tab
5. Switch to the second tab and type some letters
6. Switch to the first tab and notice how the letters typed appear in the search field (that is, the wrong tab gets focus)
Keywords: access
Could it be related to bug 314362?
Assignee: bryner → nobody
Here's another set of steps to reproduce for what I think is the same bug (and I do a slightly more complex version of these steps every day):

1. bookmark a pair of tabs in a folder, with the second tab being
   https://lists.mozilla.org/admindb/dev-planning
2. open a new browser window
3. make the window small enough that
   https://lists.mozilla.org/admindb/dev-planning needs scrollbars
4. go to the bookmark folder made in (1), and select "Open All in Tabs"
5. once they load (and you're on the first tab), hit Ctrl-PgDn to select the
   second tab
6. click in the password field
7. type a password (incorrect is fine, although it also happens with the
   correct password)
8. hit Tab to focus the "Submit" button
9. in *rapid* succession, hit Space (to submit the form) and then Ctrl-PgUp to
   switch to the first tab
10. once the tab loads, hit Ctrl-PgDn to switch back to it
11. try using the arrow keys to scroll the page (either the invalid-password
    page or the list of moderation requests)

The arrow keys don't work, but they should.  (Note that find-in-page does work, though.)
Flags: blocking1.9?
My first patch to mozilla! Be gentle :)

With this patch, the 3 repros above (comment #0, comment #1, comment #3) no longer trigger this bug.
Attachment #237332 - Flags: review?(mconnor)
Comment on attachment 237332 [details] [diff] [review]
make sure browser remember & restore the correct focus

Obsoleting patch.
This causes a regression. Focus to elements within iframes are not restored.
Attachment #237332 - Attachment is obsolete: true
Attachment #237332 - Flags: review?(mconnor)
Revised patch. Do not restore focus to elements, documents or windows that are detached.
Attachment #237735 - Flags: review?
Attachment #237735 - Flags: review? → review?(mconnor)
Attached file testcases (deleted) —
*** Bug 351513 has been marked as a duplicate of this bug. ***
Comment on attachment 237735 [details] [diff] [review]
make sure browser remember & restore the correct focus, v2

This isn't quite right.

This causes a regression. If the focus was on the url bar before switching tabs, we expect the url bar to get focus again when switching back.
Attachment #237735 - Attachment is obsolete: true
Attachment #237735 - Flags: review?(mconnor)
Flags: blocking-firefox3?
*** Bug 362885 has been marked as a duplicate of this bug. ***
*** Bug 359480 has been marked as a duplicate of this bug. ***
Oliver, can you take another crack at this?
Assignee: nobody → oliver_yeoh
Flags: blocking-firefox3? → blocking-firefox3+
I was posting my comments at bug 311376 about loss of ability to scroll with the arrow keys, but was referred to this bug.

Steps to reproduce:
1. In about:config, set security.warn_submit_insecure to true.
2. Go to a page by submitting a form by hitting Enter twice (a Google search will do)
3. Note that you can't scroll vertically using the arrow keys. Clicking the page or clicking a link (to a page without frames) will not restore it.
4. Press ' and Esc to turn FAYT on and off.
5. Arrow scrolling works again.

This is on WinXP Home running Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3.
Target Milestone: --- → Firefox 3 alpha6
Target Milestone: Firefox 3 alpha6 → Firefox 3 beta1
Target Milestone: Firefox 3 M7 → Firefox 3 M9
Target Milestone: Firefox 3 M9 → Firefox 3 M10
Summary: loss of focus if tab is deslected before initial reflow → loss of focus if tab is deselected before initial reflow
Target Milestone: Firefox 3 M10 → Firefox 3 M11
Priority: -- → P5
Assignee: oliver_yeoh → nobody
Flags: wanted-firefox3+
Flags: blocking-firefox3-
Flags: blocking-firefox3+
Target Milestone: Firefox 3 Mx → Firefox 3 M11
Target Milestone: Firefox 3 beta3 → ---

I cannot reproduce this on the latest nightly build on Windows using the steps in comment #1 and comment #3. Is this still an issue for anyone that was seeing it before?

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: