[whatwg] hit regions: event bubbling

Reading the hit region spec [1] on event handling, I was wondering how
event bubbling is supposed to be handled.
Let's say you have the following markup:

<canvas id="cnv">

<a id="a" href="..."></a>

<a id="b" href="..."></a>

</canvas>


and the following code:

var ctx = document.getElementById("cnv").getContext("2d");

var a = document.getElementById("a");

a.addEventListener("click", function(){...});

var b = document.getElementById("b");

// draw region for a

ctx.addHitRegion({control: a, id: "a"});

// draw region for b

ctx.addHitRegion({control: b, parentID: "a"});

Now, if there's a mouse click for control b, should the event be handled by
the handler for control a?

Also, should event from the fallback content bubble out of the canvas
element or should it act as a barrier?

1:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#hit-regions

Received on Saturday, 1 March 2014 02:54:58 UTC