Re: [svgwg] isPointInFill/isPointInStroke and display: none and other specifics

@fsoder Not sure what you mean with "happy accidents" on **1**. WebKit creates a render tree for elements in `<defs>` section. That is why one would get a bounding box there.

As mentioned, `x`, `y`, `width` and `height` (and others like `cx`, `cy` or even `d`) are presentation attributes (governed by CSS) and not pure DOM attributes as they used to be.

Speaking for WebKit again: While it is possible to get the attribute values, it would not be possible to get the cascading style for elements with `display: none` since WebKit does not create a render object for that element. At this point, for WebKit, the effort would be far too big to be realistic. For me that counts as not-implementable from an implementers point of view. I know that @longsonr and @heycam expressed similar concerns for Gecko in the past. Though, IIRC, Gecko does not necessarily create a "render tree" for elements in the `<defs>` section either. Hence the difference on rects in `<defs>` section you see above.

My proposal would be to not require UAs to return sane values for edge cases. I think @AmeliaBR proposed to have a vague sentence like "if a UA is unable to layout the element then [...]" with a non-normative note that `display: none` could be one reason.

The open question would then be if we return (0, 0, 0, 0) as bounding box and `false` for `isPointInStroke()`/`isPointInFill()` or if UAs should throw.

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

Received on Sunday, 11 November 2018 19:46:27 UTC