Open Bug 131784 Opened 21 years ago Updated 5 years ago
missing iframe onfocus
iframes has no onFocus event, and afaik it should have.. I don´t have an url for this, but its simple to test, just put an alert at the iframe onFocus.
Assignee: jkeiser → joki
Status: UNCONFIRMED → NEW
Component: HTMLFrames → DOM Events
Ever confirmed: true
OS: Windows XP → All
QA Contact: amar → vladimire
Hardware: PC → All
onBlur doesn't work too, even though both are specified in http://www.mozilla.org/xpfe/xulref/iframe.html Attaching a testcase for these and (commented out) all the others supported by other browsers.
Build ID: 2003021308 OS: Windows 2000 Server This sort of works. Clicking inside the iframe doesn't trigger the events, but clicking on the small grey border around the iframe first triggers the blur event, and then triggers the focus event. Clicking somewhere else triggers only the blur event.
I am developing an app where I have some elements of a form inside iframes, so that they are reloaded when something else changes in the form. Problem is that iframes participate in the "Tab-cycles-input-elements-of-forms". To solve this I have an onfocus event on the iframe which when triggered puts the focus on the first item inside the iframe. This works with IE, but not with Mozilla.
As mentioned in comment #4, clicking on the border surrounding an iframe will trigger onfocus event handler. Also, if you give a padding to iframe, you'll easily see that clicking in that padding area triggers the iframe's onfocus event handler. Though the onfocus event for iframe will not be fired when tabbing or shift-tabbing to it. "This [onfocus] attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON." http://www.w3.org/TR/html401/interact/scripts.html#adef-onfocus So, Mozilla does not have to support onfocus for iframe, even though it kinda supports it, at least internally. Same thing with Opera 7.x's "Show Active frame border setting (Preferences.../Page Style): When you view framed pages, the currently active frame will always be outlined."
Severity: major → normal
Load this document. Then try clicking, tabbing, shift-tabbing, etc.
*** Bug 253498 has been marked as a duplicate of this bug. ***
*** Bug 321263 has been marked as a duplicate of this bug. ***
I agree that W3C recomendation to event focus in HTML documents may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON, but the same example "Main document of test page" works fine in IE. Doesn't necessary to expand the padding and click it to the iframe has focus. Are there any idea to fix it and works fine in FF. Best regards
The behavior seems intentional: http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp#975
Assignee: matspal → nobody
Bulk priority change, per :mdaly
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.