SVG foreign object misses hittest of itself |
||
Issue descriptionhttp://jsbin.com/gojohi Expected: Green changes to magenta when the green area clicked. Actual: Green changes to magenta when the blue area is clicked. Reason: foreignObject doesn't receive onclick when an area in which no descendant exists is clicked.
,
Mar 28 2017
Some questions: - I just tried in Firefox, and it doesn't show background of fO at all. Does any spec define whether fO should paint CSS background? - As we paint background of fO, should "pointer-events: visiblePainted" apply to fO with a background? - Should "pointer-events: all" apply to container elements?
,
Mar 28 2017
> - I just tried in Firefox, and it doesn't show background of fO at all. Does any spec define whether fO should paint CSS background? The spec for fO [1] is generally very loose, so I don't think there any spec for whether CSS 'background' or similar embellishments should be painted. Arguably it isn't intended to define a CSS layout box though, so maybe the Gecko behavior makes more sense. This is not something I think we need to change though. [1] https://svgwg.org/svg2-draft/embedded.html#ForeignObjectElement >- As we paint background of fO, should "pointer-events: visiblePainted" apply to fO with a background? Disregarding whether a background should be painted or not, it would make sense for it to respond to pointer events in the same way as 'fill' would. >- Should "pointer-events: all" apply to container elements? Since a container wouldn't have 'fill' or 'stroke' geometry, the 'all' value would have no effect. (If there was a container which did have geometry it would arguably apply - which would feed into the above I suppose.)
,
Mar 29 2017
,
Apr 4 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by f...@opera.com
, Mar 28 2017This sounds like reasonable behavior as long as 'pointer-events' is the initial value ('visiblePainted'), but it looks like there might be some breakage for some values of 'pointer-events' ('bounding-box' most certainly.) The spec has fO as a "graphics element", although in my mind it's more of a "container element", so it becomes a bit fuzzy which p-e modes should result in hits...