Re: Clarification on mouseenter/mouseleave

>> In order to test what the bubbling behavior of an event object is, if
>> you do not trust the value of the corresponding property of the event
>> object, you have to register event listeners for an element and one of
>> its ancestors.
>
> No, I don't have to register two listeners.
> For a browser that implements the dom event model, I check target.
> In IE check toElement in mouseenter/over, fromElement in mouseleave/out  
> and srcElement in all others.
> Those properties have all the info needed.
> If I register the two listeners, the same result upholds.
>
>> Your test case only registers listeners on one element,
>> so it does not test the bubbling behavior. Your findings are mistaken,
>> http://lists.w3.org/Archives/Public/public-webapi/2008May/0111.html
>> should be a proper description of how the events are implemented in IE.
>
> I don't understand how I can be mistaken if the testcase is factual and  
> shows what I said.
> I case of doubt, I attached a slightly more explicit one, although you  
> have to inspect the output in the textarea.

After further review I got confused. IE does set the target to the inner  
element, it fires the listeners on both the inner element and outer  
element, but doesn't bubble up to the body.
Does this mean that the user agent has to fire an event for each node that  
is unhovered, each one with their separate capturing phases ?

Received on Tuesday, 29 June 2010 01:09:09 UTC