Re: [svgwg] Clarify behavior of pointer-events on nested elements (#744)

It may be worth to start by noting that the SVG specification does not claim to specify behavior for non-SVG elements (note how "Applies to" only lists SVG elements) - `pointer-events` on anything else is currently a de-facto standard without a specification (there has been intentions to move it to css-ui but nothing has happened there AFAICT). It seems a tall order to require SVG to specify hit-testing for the CSS box model and how that interacts with `pointer-events`.

But to try and answer some of your questions... based on what the SVG spec says.
`pointer-events` is an inherited property, which defines exactly how it is propagated (inherited) to the descendants, so unless cascading produces a value they inherit the value from the ancestor.
When you start to mix in `<iframe>`s you get another document, and CSS does not cross into that document, hence the value would not be "propagated". Given that `<iframe>`s are replaced content though, the waters are potentially a bit murky as to what should happen in that case. In general though comparing `<div>`s with `<iframe>`s will largely be like comparing apples and oranges.

In the nested `<div>`s case we could reason about what geometry they have (this is a basic property of SVG hit-testing works). So the boxes likely have geometry in the form of, uhm, boxes. Per SVG[1], you'd pick the top-most target, so for the nested `<div>`s (which have nothing that changes z-ordering) that would mean the `#child` is on top, and is allowed to receive "pointer events" (`pointer-events` is not `none`).

Since `<iframe>`s are replaced content they would essentially be considered to be "black boxes". They would still have their CSS box geometry in the document they are in, but how (and if) they forward anything would be a detail of the specific replaced content I think (but that is really not specified anywhere).

[1] https://svgwg.org/svg2-draft/interact.html#PointerEvents

-- 
GitHub Notification of comment by fsoder
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/744#issuecomment-537182823 using your GitHub account

Received on Tuesday, 1 October 2019 19:03:39 UTC