W3C home > Mailing lists > Public > public-svg-issues@w3.org > November 2018

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

From: Dirk Schulze via GitHub <sysbot+gh@w3.org>
Date: Sun, 11 Nov 2018 19:46:26 +0000
To: public-svg-issues@w3.org
Message-ID: <issue_comment.created-437698710-1541965585-sysbot+gh@w3.org>
@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

This archive was generated by hypermail 2.3.1 : Sunday, 11 November 2018 19:46:27 UTC