Open Bug 212818 Opened 21 years ago Updated 2 years ago

Setting frame focus does not work

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: grasso, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624

Setting frame focus, in Javascript it is called "focus()", does not work. I have
made three slightly different testcases.

I think that frames should be able to change other frames and the frameset, or
am I wrong? I remember they did in earlier versions of Mozilla. Maybe it is
related to http://bugzilla.mozilla.org/show_bug.cgi?id=202955 Please also
consider that self.document.title=self.right.document.title does work, see
testcases! That is inconsistent.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
.

Expected Results:  
.
What happens if you don't call this onload?  The issue is that Mozilla itself
has an onload handler attached to the toplevel frameset; this handler focuses
the frameset.  This fires after all the frames' onload handlers, of course...

A standard frameset, without addditional "onload"s, focuses on none of its
frames, see frameset4.htm in testcase directory! Scrolling with page up and down
does not work unless one clicks with the mouse in a frame. 

>This fires after all the frames' onload handlers, of course...

Obviously but not naturally. It could focus itself just after initialization of
the frameset, just like framesetless windows focus themselves after window
initialization.
As I said that _could_ be the problem. It may not be.  Does calling the focus()
function on a button press instead of onload work?  I'm just trying to establish
the scope of the problem before I start trying to look for code to change... ;)
> Does calling the focus()
function on a button press instead of onload work?  

No: http://grassomusic.de/testcases/frames_focus/frameset4.htm
Yeah, even changing that input to type="button" does not work.  bryner, any idea
what's up here?
OS: Windows 98 → All
Hardware: PC → All
Ok, the bug appears to only happen when an alert() is used before the focus
call.  Just a guess, this is probably focus memory restoration racing with the
second .focus() call.  Confirming and taking.
Assignee: dom_bugs → bryner
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Setting frame focus does not work → Setting frame focus after alert() does not work
> Ok, the bug appears to only happen when an alert() is used before the focus
call.  

Not on my machine. I erased the alert call in the testcase (and changed the type
to "button", yes!) so everyone can try out. 
Summary: Setting frame focus after alert() does not work → Setting frame focus does not work
Assignee: bryner → general
QA Contact: ashshbhatt → ian
Assignee: general → nobody
QA Contact: ian → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.