Re: Mouseover/mouseout event stopping over shadow scopes in sXBL

On Thu, 20 Jan 2005, Cameron McCormack wrote:
> 
> Say you had this document:
> 
>   <svg ...>
>     <xbl:xbl>
>       <xbl:definition element="ex:test1">
>         <xbl:template>
> 	  <rect width="100" height="100"/>
> 	  <ex:test2/>
> 	</xbl:template>
>       </xbl:definition>
>       <xbl:definition element="ex:test2">
>         <xbl:template>
> 	  <circle cx="100" cy="100" r="50"/>
> 	</xbl:template>
>       </xbl:definition>
>     </xbl:xbl>
> 
>     <ex:test1/>
>   </svg>
> 
> and the mouse was moved from over the circle to over the rect.
> Would I be right in guessing that these are the events that should be
> fired?
> 
>   phase	type		target		currentTarget
> 
>   CAPTURING	mouseout	ex:test2	ex:test1
>   CAPTURING	mouseout	circle		ex:test2
>   AT_TARGET	mouseout	circle		circle
>   BUBBLING	mouseout	circle		ex:test2
>   BUBBLING	mouseout	ex:test2	ex:test1
>   CAPTURING	mouseover	rect		ex:test1
>   AT_TARGET	mouseover	rect		rect
>   BUBBLING	mouseover	rect		ex:test1

No, the retargetting/stopping happens before you hit the bound element. If 
you move the mouse from over the circle to over the rect you get:

    CAPTURING	mouseout	ex:test2	ex:test2
    AT_TARGET	mouseout	circle		circle
    BUBBLING	mouseout	ex:test2	ex:test2
    AT_TARGET	mouseover	rect		rect

Note that the target is also changed (you can get to the real target by 
looking up the originalEvent object) -- it is possible to tell that the 
event was redirected without looking at originalEvent because the target 
and currentTarget will be the same without the phase being AT_TARGET.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 8 February 2005 15:39:31 UTC