Closed Bug 170811 Opened 22 years ago Closed 21 years ago

after following link from iframe which loads in parent frame, focus is lost

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: bugzilla, Assigned: bryner)

References

(Blocks 1 open bug, )

Details

(Keywords: access, regression, topembed+)

Attachments

(1 file)

found using 2002.09.24.08 comm trunk builds (also a problem on mozilla).

after i follow a link in the tinderbox popup (associated with someone's
checkin), focus is lost in the resulting page.

i don't think this is a regression from the fix for bug 141295, as i remember
this was still an issue before the fix there was checked in.

1. go to http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey
2. click on a user's link in the "Guilty" column.
3. in the resulting pop-up, click on any of the first 3 links, which are
redirects to bonsai queries. eg, i often click "Check-ins within 24 hours"
4. wait for the bonsai query page to finish loading, then attempt to
scroll/navigate in the content area with the keyboard.

results: focus is lost, and unable to navigate the content area with the
keyboard. space, pageUp/Down, arrow keys do nothing --even hitting the tab key
doesn't restore/display focus (it's not in the urlbar either). need to
mouseclick to set focus.
side note: chimera does not exhibit this. not sure if that's coz chimera is on a
branch or a cocoa app...
Blocks: focusnav
Severity: major → normal
Keywords: access, nsbeta1
Keywords: sec508
QA Contact: rakeshmishra → trix
okay, moz1.0 didn't have this (because ns7.0 doesn't show this). will narrow down...
Keywords: regression
looks like this regressed btwn the moz1.0 (fine) and moz1.1 (broken) releases.
sorry about the wide interval, but i don't have any trunk builds prior to
2002.06.10 (where it's broken).
Keywords: topembed
the 1.0 branch was created on 4/9/2002, so there's about a 2 month checkin
window.  Most likely suspects:

aaronl, bug 130969, 5/16/2002
bryner, bug 138237, 6/6/2002
since the fix for bug 138237 went into the moz1.0 branch as well as the trunk,
would it still be considered suspect?
Topembed+ assuming it is in Gecko; if it is an app-level problem, topembed does
not apply.
Keywords: topembedtopembed+
this bug does occur with a *trunk* chimera test build that bryner whipped up
(from last month). so, yeah, i think it is a gecko issue.
The regression isn't from either of the bugs I mentioned.  Guess I'll need to
pull some trees by date.
jrgm sees this in a linux build from 4/25/2002, so that narrows the window
considerably.
possible causes in this checkin window:

- jag, bug 37638 / bug 89835, 4/10/2002  [unlikely, unless Chimera-specific code
has the exact same bug]
- joki, bug 78989, 4/14/2002
- bryner, bug 106123, 4/15/2002
- bryner, bug 88239, 4/23/2002 (same deal as jag's checkin)

also could be related to <iframe> checkins:

bug 127891
bug 138676
bug 52334
I narrowed this down to checkins between 4/16/2002 08:00 and 4/17/2002 08:00. 
It's almost definitely jst's checkin for iframe loading (bug 52334).

Additionally, the problem happens any time focus is in an iframe and a link is
followed.  For example, if I load tinderbox and click on the link inside the
ports iframe, focus is dead.  Updating the summary to reflect this.

jst, any ideas here?  I'm particularly interested in what might have changed in
regards to destruction of iframes.
Summary: after following link from tbox pop-up, focus is lost → after following link from iframe, focus is lost
Summary: after following link from iframe, focus is lost → after following link from iframe which loads in parent frame, focus is lost
Attached patch patchSplinter Review
The changes in iframe loading require some changes in the logic here. 
Basically, since the iframe element now owns the frame loader, the iframe's
document can hang around past frame destruction (until a js gc, even).	So,
that's no longer a good way to detect that we're replacing the document in a
parent window of the focused window.  I've implemented the following approach:

- walk up the document chain starting with the document for the focused dom
window
- stop when we hit
  a) the top of the document chain.  this means the focused window is not a
child of the window we're loading into and focus should be unaffected.
  b) a document with no window.  this can mean that the dom window is now
showing another document, and we should go ahead and take focus.
  c) the dom window that this document is loading in.  this means that we are
replacing a document in a parent of the focused window and we should also take
focus.

I tested this on windows and linux and found no problems on either platform.
Attachment #119225 - Flags: superreview?(jst)
Attachment #119225 - Flags: review?(saari)
Comment on attachment 119225 [details] [diff] [review]
patch

sounds reasonable enough, as long as jst agrees the new logic is sound. r=saari
Attachment #119225 - Flags: review?(saari) → review+
Comment on attachment 119225 [details] [diff] [review]
patch

sr=jst
Attachment #119225 - Flags: superreview?(jst) → superreview+
fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
brian, thanks so much for investigating and fixing this.

vrfy'd fixed with 2003.04.03 comm trunk builds (win2k, mac os 10.2.4, linux rh8.0).
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: