Re: [svgwg] fill-rule Could Use Some Clarification

`fill-rule` is not merely an attribute; it is an inheritable style property and presentation attribute. It can be defined [on any SVG-namespaced element in SVG 2](https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute), and [most SVG-namespaced elements in SVG 1.1](https://www.w3.org/TR/SVG11/attindex.html#PresentationAttributes) regardless of whether or not it has an effect on that element.  In particular, it has _always_ been valid as an attribute on `<g>`; however, as @svgeesus explained, it does not apply at the group level, but by inheriting down to individual shape and text elements (just like the `fill` or `stroke` properties do).  It would therefore be unacceptable to change its behavior.

The "Applies to" section of the [`fill-rule` definition](https://svgwg.org/svg2-draft/painting.html#FillRuleProperty) _could_ be narrowed to only list the elements on which it would ever have a visible effect, since "Applies to" defines which elements actually use the style property. However, I personally see that as unnecessarily complicating matters.  The `fill-rule` applies to a `<circle>` in the exact same way that it applies to a `<path>` element describing the same circular shape.  It is OK that definition of `fill-rule` refers specifically to paths, because all the basic shapes are now defined in terms of ["equivalent paths"](https://svgwg.org/svg2-draft/paths.html#TermEquivalentPath).

I *do* agree that it would be very nice if SVG had a feature for creating compound shapes that are the intersection or union of multiple simple shapes.  But that is quite a more complicated matter than what `fill-rule` can do.

That said...

The application of `fill-rule` to _text_ does need to be clarified.

In the [Text chapter](https://svgwg.org/svg2-draft/text.html#TextRenderingOrder), we currently have an informative note that says "Since the fill-rule property does not apply to SVG text elements, the specific order of the subpaths within the equivalent path does not matter."  That contradicts the [`fill-rule` definition](https://svgwg.org/svg2-draft/painting.html#FillRuleProperty) that says it _does_ apply to text content elements.  We need to decide which one it is (probably by testing current SVG implementations to see what they are doing), and we definitely need some tests to match.

There should also be tests for `fill-rule` and `<polygon>` and `<polyline>`, and maybe (for completeness) the other basic shapes.

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

Received on Saturday, 16 September 2017 22:29:18 UTC