[WSG] Firefox onblur and onfocus event bubbling bug

2005-11-06 Thread Focas, Grant








Hi standardistas,



Ive had a problem with onfocus and onblur where
Firefox is calling onblur before onfocus when clicking on an input element.

This is a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=53118
) because it goes against the DOM2 Event handling spec.

The only way around it at the moment seems to be to check
whether youre running on Gecko via client sniffing and insert a
conditional code fork in your _javascript_ so [] you explicitly
preventBubbles on the event that really shoulndt bubble in the first
place. (from the page referred to above).



Just thought Id let those of you unaware of this
issue know so you dont have to suffer the same frustration Ive
had trying to figure out whats happened. Anyone with Firefox 1.5 beta
know if this issue is fixed in that version?



Heres my test:



HTML:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0
Transitional//EN 

html

head

titleonblur test/title

/head

body

input name=test type=text
id=test  called');
 called'); 
called');  called'); /

/body

/html





IE6 

using a mouse to click into the textbox alerts onfocus
called

using a mouse to click outside the textbox alerts onblur
called

keyboard tabbing to the textbox alerts onfocus called

keyboard tabbing out of the textbox alerts onblur
called, followed by onkeydown called followed by onfocus
called followed by onblur



Firefox 1.07



using a mouse to click into the textbox alerts onblur
called followed by onfocus called

using a mouse to click outside the textbox alerts onblur
called

keyboard tabbing to the textbox alerts onblur called
followed by onfocus called

keyboard tabbing out of the textbox alerts onblur
called, followed by onkeydown called 



Grant Focas




**This message is intended for the addressee named and may containprivileged information or confidential information or both. If youare not the intended recipient please delete it and notify the sender.**





Re: [WSG] Firefox onblur and onfocus event bubbling bug

2005-11-06 Thread Patrick H. Lauke

Focas, Grant wrote:

 Anyone with Firefox 1.5 beta know if this issue is
fixed in that version?


Firefox 1.5rc1 still has the same faulty behaviour...how weird.

--
Patrick H. Lauke
__
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__
**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



RE: [WSG] Firefox onblur and onfocus event bubbling bug

2005-11-06 Thread Paul Noone



You must Focas. Sorry, couldn't resist. 
:P

Thanks for the heads-up.


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Focas, 
GrantSent: Monday, 7 November 2005 12:12 PMTo: 
wsg@webstandardsgroup.orgSubject: [WSG] Firefox onblur and onfocus 
event bubbling bug


Hi 
standardistas,

Ive had a problem with onfocus and 
onblur where Firefox is calling onblur before onfocus when clicking on an input 
element.
This is a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=53118 
) because it goes against the DOM2 Event handling 
spec.
The only way around it at the moment 
seems to be to check whether youre running on Gecko via client sniffing and 
insert a conditional code fork in your _javascript_ so [] you explicitly 
preventBubbles on the event that really shoulndt bubble in the first place. 
(from the page referred to above).

Just thought Id let those of you 
unaware of this issue know so you dont have to suffer the same frustration Ive 
had trying to figure out whats happened. Anyone with Firefox 1.5 beta know if 
this issue is fixed in that version?

Heres my 
test:

HTML:
!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.0 Transitional//EN" 
html
head
titleonblur 
test/title
/head
body
input name="test" type="text" 
id="test" 
/
/body
/html


IE6 
using a mouse to click into the 
textbox alerts onfocus called
using a mouse to click outside the 
textbox alerts onblur called
keyboard tabbing to the textbox 
alerts onfocus called
keyboard tabbing out of the textbox 
alerts onblur called, followed by onkeydown called followed by onfocus 
called followed by onblur

Firefox 
1.07

using a mouse to click into the 
textbox alerts onblur called followed by onfocus 
called
using a mouse to click outside the 
textbox alerts onblur called
keyboard tabbing to the textbox 
alerts onblur called followed by onfocus called
keyboard tabbing out of the textbox 
alerts onblur called, followed by onkeydown called 


Grant Focas**This message is intended for the addressee named and may containprivileged information or confidential information or both. If youare not the intended recipient please delete it and notify the sender.**