[whatwg] Hit regions and events

Rik Cabanier cabanier at gmail.com
Tue Mar 4 20:22:05 PST 2014


On Tue, Mar 4, 2014 at 8:10 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Tue, 4 Mar 2014, Rik Cabanier wrote:
> > On Tue, Mar 4, 2014 at 6:07 PM, Ian Hickson <ian at hixie.ch> wrote:
> > > On Tue, 4 Mar 2014, Rik Cabanier wrote:
> > > >
> > > > Ok. It seems odd that the events are following the dom of the
> > > > fallback elements and not of the hit regions.
> > >
> > > It's what events normally do. I guess we could make this more
> > > elaborate, but it's not clear what the use case is. Can you elaborate?
> >
> > The weirdness is that the pseudo hit region DOM can be different from the
> > fallback dom.
> > So, if b is a child of a, but the fallback element for b is not a child
> of
> > the fallback element for a, you won't get the event on a if you hit b.
>
> It's not really a "fallback DOM". The events don't bubble through the
> regions if they're not attached to a control. The "parent" chain is just a
> convenient way of managing related regions.


OK


> > > I couldn't really see a sane way to do it (e.g. consider if two
> > > touches change at the same time, but they started on different regions
> > > on the same canvas). Do you have a proposal for how to make touch
> > > event rerouting work for canvas regions?
> >
> > The touch class [1] could be updated with a region string.
> > As you move your fingers, the id would reflect what regions your fingers
> > are on.
>
> So what would you do in the case where you start two touches on different
> regions, then move them at the same time to two other different regions at
> the same time? What would you put in the touchmove event's object?


yes.
This is not all that different from how the mouse events work with hit
regions.
You'd get a mouse enter as you enter the canvas with the mouse. As you move
over the canvas, you will get more mouse move events with different region
id's and target elements.
There will be no separate mouse enter/leave events when you enter/leave a
region.



More information about the whatwg mailing list