[whatwg] isPointInPath v. set of pixels in canvas hit regions

Charles Pritchard chuck at jumis.com
Thu Jul 5 22:54:35 PDT 2012

On Jul 5, 2012, at 10:06 PM, Ian Hickson <ian at hixie.ch> wrote:

>> I think its up to the author to manage their set of paths appropriately, 
>> independently from the drawing operations.
> Having the drawing mechanism work in a tightly integrated fashion with the 
> region code IMHO helps authors avoid bugs. You don't have to track which 
> regions you've defined, you just make sure to draw the regions while 
> you're drawing the paths and it all Just Works. Not having to track the 
> regions is the entire point of how this API was designed -- it's also the 
> main differentiating factor between this API's design and the design of 
> hit testing in retained-mode APIs such as SVG.

It's a poor design you've settled on: the purpose of these methods is to associate path information with DOM nodes. Path information is retained in relationship to DOM nodes as part of the integration of Canvas and DOM.

It's supposed to be like SVG because we want to retain DOM nodes with vector data to meet accessibility needs.


More information about the whatwg mailing list