Proposals/Hit testing

From SVG
< Proposals
Revision as of 14:51, 6 May 2012 by Cmccorma (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a proposal for an API that can help with hit testing of the different parts of an element – fill, stroke and markers – separately.

[Constructor(UIEvent event, optional Element context)]
interface SVGPoint {

dictionary MarkerDetails {
  long index;
  SVGMarkerElement? element;
  float position;

interface SVGLocatable {
  bool isPointInFill(SVGPoint point);
  bool isPointInFill(UIEvent event);

  bool isPointInStroke(SVGPoint point);
  bool isPointInStroke(UIEvent event);

  bool isPointInMarker(SVGPoint point, optional unsigned long index);
  bool isPointInMarker(UIEvent event, optional unsigned long index);

  MarkerDetails getMarkerFromPoint(SVGPoint point);
  MarkerDetails getMarkerFromPoint(UIEvent event);
  MarkerDetails getMarkerAtIndex(unsigned long index);

Can we make pointer-events="painted" or "all" mean markers too? Or do we need a new property for that?