Closed Bug 170554 Opened 22 years ago Closed 19 years ago

HTMLIFrameElement does not have a focus() method

Categories

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

defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mjw, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase, Whiteboard: WG needs to make a call)

Attachments

(1 file, 2 obsolete files)

When I call focus() on an iFrame an exception is thrown.  This doesn't seem like
it should occur as the underlying XUL layer can call focus and blur on iframes.
 When I add focus and blur functions, they too are never called.  Sounds like a
bug with iframes.  I will attach a sample
Attached file Test Case (obsolete) —
This works in IE and throws an Exception in Mozilla 1.1
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
See http://www.w3.org/TR/2002/CR-DOM-Level-2-HTML-20020605/html.html#ID-50708718
-- iframe elements do not have a focus() method in the standard DOM.

Over to DOM HTML to decide whether the W3C cares to adjust the spec here or not.
Assignee: joki → jst
Component: DOM Events → DOM HTML
OS: Windows 2000 → All
QA Contact: vladimire → stummala
Hardware: PC → All
Summary: DHTML iFrame.focus() → HTMLIFrameElement does not have a focus() method
Whiteboard: WG needs to make a call
Workaround:
instead of calling 'select.add( option )', call 'select[select.length] = option'.
Seems to work for the time being.
Severity: normal → minor
Ignore last comment, wrong bug number
How about undoing the Severity change you made too, eh?
Severity: minor → normal
I don't believe you are supposed to be focusing the iframe, you are supposed to
be focusing the iframe contentWindow.

So:

document.getElementById("iframename").contentWindow.focus();

Of course, this doesn't work either, and it has serious implications for Midas
(editor within Mozilla).

You can't focus an iframe when it is in edit mode.

Severity: normal → enhancement
Attached file New testcase (obsolete) —
This testcase is timing based and easier to see.

After five seconds, focus should move to the iframe. It doesn't.

Works in IE and should work in Mozilla.

You get no errors in the Javascript console.

Note the fact that the IFRAME is in designMode has nothing to do with this. I
did that so it would be more obvious that focus switched to the IFRAME.
Attachment #100429 - Attachment is obsolete: true
Severity: enhancement → major
Ooops - previous test was 10 second, not 5 so text in testcase didn't match.
Attachment #110993 - Attachment is obsolete: true
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Blocks: focusnav
The test case worksforme in Deer Park Alpha 2. Marking so.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: