<canvas> hit region API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

<canvas> hit region API

Anne van Kesteren-4
Hey,

This is a heads up that we're strongly considering changing the
<canvas> hit regions API in
https://github.com/whatwg/html/issues/1030.

In particular, nobody could articulate why the API was ID-based rather
than element-based, why it had to be 2d-context specific, and why the
region ID had to be exposed on event classes.

Please let us know as soon as possible if you have concerns with this change.

Kind regards,


--
https://annevankesteren.nl/

Reply | Threaded
Open this post in threaded view
|

RE: <canvas> hit region API

Frank Olivier
Thanks for the heads up. I have no concerns about evolving the API, given its current state of implementation.

"nobody could articulate why the API was ID-based rather than element-based,"
If I recall correctly, there was protracted discussion about having an ID-based API *and* and alternative element-based API. One of the arguments for an ID-based interface was to ensure that developers could create accessible canvas elements without having to create a 'costly' DOM element for each object in the canvas that needed to be made accessible. (Consider the case where the canvas is used to draw a scatter plot with a huge number of points, or is used to draw a star map with a huge number of stars.) Personally, I feel a single element-only approach is simpler.

"why it had to be 2d-context specific"
I think this was just an oversight.

"why the region ID had to be exposed on event classes."
I think this was the consensus solution for the case where no element was used (the ID-based path). There are no doubt better approaches here - for one, .region is a very generic name.


Thanks
Frank



-----Original Message-----
From: Anne van Kesteren [mailto:[hidden email]]
Sent: Monday, April 18, 2016 7:24 AM
To: Frank Olivier <[hidden email]>; Justin Novosad <[hidden email]>; Adrian Bateman <[hidden email]>; Olli Pettay <[hidden email]>; www-archive <[hidden email]>
Subject: <canvas> hit region API

Hey,

This is a heads up that we're strongly considering changing the <canvas> hit regions API in https://github.com/whatwg/html/issues/1030.

In particular, nobody could articulate why the API was ID-based rather than element-based, why it had to be 2d-context specific, and why the region ID had to be exposed on event classes.

Please let us know as soon as possible if you have concerns with this change.

Kind regards,


--
https://annevankesteren.nl/