<br><br><div><span class="gmail_quote">2007/3/15, Magnus Kristiansen <<a href="mailto:magnusrk+whatwg@pvv.org">magnusrk+whatwg@pvv.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, 15 Mar 2007 20:10:33 +0100, Gareth Hay <<a href="mailto:gazhay@gmail.com">gazhay@gmail.com</a>> wrote:<br><br>> I'm not so sure it is a workaround though.<br>> If you know that the event will bubble, you can make your handler
<br>> prevent bubbling.<br>><br>> I don't think we should be adding two new events to a spec, when the<br>> existing events can work in the way you want, albeit with a line more<br>> code. If we did, we'd be forever adding very specialized events.
<br><br>You don't seem to understand the situation. Imagine there's a parent<br>element and several child elements. Every time you mouse over a child<br>element, a mouseover event triggers (and mouseout on the previous
<br>element). This event bubbles up until it reaches the parent element. An<br>event handler on the parent can only prevent the events from bubbling<br>event further (which is not relevant), not from reaching itself.<br><br>
To prevent it using bubble cancelling you would have to attach events<br>stopping bubbling to every child element of the target. Not only is this<br>an unreliable way of doing it, it also interferes with potential other<br>
elements which actually want bubbling. The other, more practical<br>workaround is to look at each incoming event and check "did this one come<br>bubbling up, or does it belong here". However, workarounds do not solve
<br>the problem itself.<br><br>With mouseenter/leave, there is no bubbling. There is no need to attach<br>handlers to arbitrary elements, and no need to manually check each<br>incoming event to see if it's bubbling or direct. These events are linked
<br>to a significant enough use case. They are no more redundant than existing<br>events like click (mousedown+mouseup) and keypress (keydown+keyup).</blockquote><div><br><br>Yeah, I sort of half remembered a situation where I really had a need for mousenter/mouseleave.
<br>I got in a similar situation as you describe.<br>I too think mouseenter/mouseleave events would be a useful addition.<br><br>Regards,<br>Martijn<br></div><br></div>