Status

()

P5
normal
17 years ago
8 months ago

People

(Reporter: thiago, Unassigned)

Tracking

(Blocks: 1 bug, {access, testcase})

Trunk
access, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: INVALID?)

Attachments

(3 attachments, 3 obsolete attachments)

(Reporter)

Description

17 years ago
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.
events
Assignee: jkeiser → joki
Status: UNCONFIRMED → NEW
Component: HTMLFrames → DOM Events
Ever confirmed: true
OS: Windows XP → All
QA Contact: amar → vladimire
Hardware: PC → All

Comment 2

17 years ago
Created attachment 84514 [details]
testcase for onBlur and onFocus

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.

Comment 3

16 years ago
Created attachment 109879 [details]
html testcase

Updated

16 years ago
Priority: -- → P3

Comment 4

16 years ago
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.

Comment 5

15 years ago
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.

Comment 6

15 years ago
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

Comment 7

15 years ago
Created attachment 151852 [details]
Iframed document
Attachment #84514 - Attachment is obsolete: true

Comment 8

15 years ago
Created attachment 151853 [details]
Main document of test page

Load this document.
Then try clicking, tabbing, shift-tabbing, etc.

Comment 9

15 years ago
*** Bug 253498 has been marked as a duplicate of this bug. ***

Updated

15 years ago
Assignee: joki → events

Updated

15 years ago
Blocks: 83552
*** Bug 321263 has been marked as a duplicate of this bug. ***

Comment 11

13 years ago
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  

Comment 12

13 years ago
<HTML>
<HEAD>
<TITLE>TEST PAGE</TITLE>
<!-- no cache headers -->
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY topmargin=0 leftmargin=0>
<IFRAME src='http://www.mypage.org/adsense.html' frameborder='0' width='300' height='50' onFocus='logClick()'></iframe>
<script type="text/javascript">
function logClick() {
    window.focus();
    bug = new Image();  
    bug.src = 'http://mypage.org/track.php?pg=' + escape(document.title);
}
</script>
</BODY>
</HTML>

Above javascript code wont work with mozilla, but it work with IE.. Whats wrong? Please help me..

Updated

13 years ago
Assignee: events → mats.palmgren
Keywords: access
QA Contact: vladimire → events
Created attachment 396895 [details]
Iframed document
Attachment #151852 - Attachment is obsolete: true
Created attachment 396897 [details]
Main document of test page
Attachment #151853 - Attachment is obsolete: true
The behavior seems intentional:
http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp#975
Assignee: matspal → nobody
Keywords: testcase
Whiteboard: INVALID?
Bulk priority change, per :mdaly
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.