Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: addEvent - ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 23 of 65 Topic 36258 of 37133
Post > Topic >>

Re: addEvent - The late entry :)

by dhtml <dhtmlkitchen@[EMAIL PROTECTED] > Jul 25, 2008 at 12:46 AM

On Jul 20, 1:37=A0am, Thomas 'PointedEars' Lahn <PointedE...@[EMAIL PROTECTED]
>
wrote:
> dhtml wrote:
> > On Jul 19, 6:49 pm, "Aaron Gray" <ang.use...@[EMAIL PROTECTED]
> wrote:
> >> Here's yet another mod :-
>
> > There are some significant differences in attachEvent and
> > addEventListener.
>
> > * w3c DOM Event bugs in Webkit and Safari (and probably a lot in Opera
> > that I'm not aware of).
>
> Could you elaborate on that, please?
>

In Webkit and Firefox (I meant to say), events fire on bubble when
useCapture has been set to true. This is a bug and in direct violation
of the Events spec, which states:

| useCapture of type boolean
|    If true, useCapture indicates that the user wishes to
| initiate capture. After initiating capture, all events of the
| specified type will be dispatched to the registered
| EventListener before being dispatched to any EventTargets
| beneath them in the tree. Events which are bubbling upward
| through the tree will not trigger an EventListener designated
| to use capture.

"Events which are bubbling upward through the tree will not trigger an
EventListener designated to use capture."

https://bugzilla.mozilla.org/show_bug.cgi?id=3D235441
https://bugs.webkit.org/show_bug.cgi?id=3D9127

The spec statment was strengthened in D3E:
http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events-EventTarget-addE=
ventListener

| useCapture of type boolean
|   If true, useCapture indicates that the user wishes to add
| the event listener for the capture phase only, i.e. this
| event listener will not be triggered during the target and
| bubbling phases. If false, the event listener will only be
| triggered during the target and bubbling phases.


> > * w3c DOM Events bubble as specified, IE events bubble differently,
> > like legacy events (by "legacy" events, I mean el.onclick =3D ...)
>
> Could you provide a test case that demonstrates the issue, please?
>

I was wrong about the legacy events bubbling differently, but not
about IE DOM Events. They don't bubble the same.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-h=
tmlevents

| change
| The change event occurs when a control loses the input focus and its
| value has been modified since gaining focus. This event is valid for
| INPUT, SELECT, and TEXTAREA. element.
| Bubbles: Yes
| Cancelable: No
| Context Info: None
|
| submit
| The submit event occurs when a form is submitted. This event only
| applies to the FORM element.
| Bubbles: Yes
| Cancelable: Yes
| Context Info: None

Both of these events should bubble.
Moz and Safari: these events bubble when registered with
addEventListener.

IE: these events don't bubble

MSDN docs
 onchange: http://msdn.microsoft.com/en-us/library/ms536912(VS.85).aspx
 onsubmit: http://msdn.microsoft.com/en-us/library/ms536972.aspx

I'll post up an example tomorrow.


> > * different thisArg - attachEvent's this is always window
>
> and
>
> * event listeners *added* with addEventListener() are executed
> =A0 *in order of addition*;
>
> =A0 event listeners *attached* with attachEvent() are executed
> =A0 *in arbitrary order*
>

Good to know, but I can't think of a good reason for relying on the
order.


> PointedEars
 




 65 Posts in Topic:
addEvent - The late entry :)
"Aaron Gray" &l  2008-07-16 16:17:14 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-16 17:28:50 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 01:09:15 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 01:32:44 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 02:49:20 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 02:54:32 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 13:57:48 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 18:23:17 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 18:50:43 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 22:30:43 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 23:22:31 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 18:25:01 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 18:50:39 
Re: addEvent - The late entry :)
"Aaron Gray" &l  2008-07-20 20:30:25 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 23:22:25 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-19 19:00:46 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-19 19:01:18 
Re: addEvent - The late entry :)
Thomas 'PointedEars' Lahn  2008-07-20 10:37:01 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-20 10:59:25 
Re: addEvent - The late entry :)
Thomas 'PointedEars' Lahn  2008-07-21 02:07:40 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-20 17:33:45 
Re: addEvent - The late entry :)
Thomas 'PointedEars' Lahn  2008-07-21 03:28:43 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-25 00:46:00 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-25 18:28:06 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-25 18:30:42 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 13:40:29 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-20 11:36:48 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-20 23:02:34 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-20 17:09:03 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-08-30 15:27:52 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-08-30 20:33:34 
Re: addEvent - The late entry :)
kangax <kangax@[EMAIL   2008-07-20 21:20:28 
Re: addEvent - The late entry :)
jdalton <John.David.Da  2008-07-20 22:46:59 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-21 22:37:35 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-22 01:36:52 
Re: addEvent - The late entry :)
kangax <kangax@[EMAIL   2008-07-21 17:58:43 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-24 01:44:03 
Re: addEvent - The late entry :)
Lasse Reichstein Nielsen   2008-07-22 03:33:51 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-22 08:46:35 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-21 21:47:30 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-22 08:46:40 
Re: addEvent - The late entry :)
RobG <rgqld@[EMAIL PRO  2008-07-21 23:34:03 
Re: addEvent - The late entry :)
RobG <rgqld@[EMAIL PRO  2008-07-21 23:40:09 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-23 18:32:54 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-26 16:18:58 
Re: addEvent - The late entry :)
kangax <kangax@[EMAIL   2008-07-23 18:46:05 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-26 16:18:53 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-25 01:45:13 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-26 10:15:22 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-27 22:53:48 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-26 17:07:57 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-26 17:11:38 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-27 22:53:43 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-26 17:19:52 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-27 22:53:53 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-27 00:04:12 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-27 15:21:49 
Re: addEvent - The late entry :)
"Richard Cornford&qu  2008-07-27 23:48:51 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-27 15:30:52 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-27 15:40:27 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-27 15:49:42 
Re: addEvent - The late entry :)
Jorge <jorge@[EMAIL PR  2008-07-27 16:07:34 
Re: addEvent - The late entry :)
dhtml <dhtmlkitchen@[E  2008-07-27 21:32:03 
Re: addEvent - The late entry :)
Peter Michaux <petermi  2008-07-20 10:37:06 
Re: addEvent - The late entry :)
Thomas 'PointedEars' Lahn  2008-07-21 02:57:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 2:13:23 CDT 2008.