weisJ / jsvg

Java SVG renderer
MIT License
116 stars 6 forks source link

`paint-order` not applied to `<use>` #83

Open stanio opened 2 weeks ago

stanio commented 2 weeks ago
use-paint-order.svg ```xml ```
Actual Expected
actual expected
weisJ commented 2 weeks ago

I'm not sure behaviour of other implementations actually is correct here. Per the spec https://svgwg.org/svg2-draft/painting.html#PaintOrder the paint-order property is only allowed on the following elements

It is inherited though that should only apply to text content elements as out of the above elements only text actually is a container type (in the sense that is can have visible children).

stanio commented 2 weeks ago

Looks similar to the fill attribute. It is said it applies to just shapes and text content elements but then it is inherited and one could specify fill="..." on the root <svg> or <g> element – that one is handled by JSVG.

stanio commented 2 weeks ago

I think "applies to" and which element could specify the attribute are two different parts. The <use> element is specified to have presentation attributes that include paint-order. "Style Scoping and Inheritance" further specify how these apply to referenced elements.

weisJ commented 1 week ago

Ah it has been to long since I worked on inherited properties. This makes a lot of sense.

weisJ commented 1 week ago

Should be fixed in current snapshot

stanio commented 1 week ago

Tested with current 1.5.1-SNAPSHOT – works as expected now.