W3C home > Mailing lists > Public > www-svg@w3.org > February 2005

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

From: Jon Ferraiolo <jon.ferraiolo@adobe.com>
Date: Tue, 08 Feb 2005 15:16:37 -0800
To: Ian Hickson <ian@hixie.ch>, Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Cc: www-svg@w3.org
Message-id: <6.1.1.1.2.20050208150729.05c19350@mailsj-v1.corp.adobe.com>

I agree with Ian's analysis. I will expand on it (and hope Ian agrees with 
this).

Event flow follows the flattened tree. In this case, the flattened tree 
looks like this:

svg:svg
   ex:test1
      rect
      ex:test2
          circle

Thus, if I remember my DOM Events properly, capture starts with the 
Document object and descends to the target element, and bubbling starts 
with the target element and ascends to the Document object.

XBL adds the extra wrinkle with event marshalling at the shadow tree 
boundary such that a new Event object is created when you capture/bubble 
across the boundary per the rules documented at 
(http://www.w3.org/TR/sXBL/#event7).

Jon


At 07:39 AM 2/8/2005, Ian Hickson wrote:

>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 23:17:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:39:55 UTC