[svgwg] What should the computed value of the `marker` shorthand property be when its longhands have different values (#983)

weinig has just created a new issue for https://github.com/w3c/svgwg:

== What should the computed value of the `marker` shorthand property be when its longhands have different values ==
The `marker` property shorthand (https://svgwg.org/svg2-draft/painting.html#MarkerShorthand) is clear on what it will do on setting; it sets the provided value to all three of its longhands,  `marker-start`, `marker-mid` and `marker-end`.

It's not clear on what the computed value serialization should be, only saying "see individual properties". "see individual properties" would be fine if the grammar of the shorthand reference all three, but since it doesn't there is no clear serialization to use, especially in cases where the longhands don't all share the same value.

My proposal would be to augment the grammar of the shorthand to allow specifying 1 or 3 values like so:

```
<'marker'> = [none | <marker-ref>] | [none | <marker-ref>]{3}
```

- If 1 value is provided - it works like today, setting  `marker-start`, `marker-mid` and `marker-end` to the value.
- If 3 values are provided - It sets `marker-start` to the first, `marker-mid` to the second and `marker-end` to the third.


Serialization would fall out of this:

- If  `marker-start`, `marker-mid` and `marker-end` are all the same, `marker` serializes as that single value.
- If  `marker-start`, `marker-mid` and `marker-end` are not all the same, `marker` serializes as the three values separated by spaces.

(one might be able to come up with a coalescing scheme where `marker` with two values does something, but I couldn't think of a satisfactory one).

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/983 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 23 June 2025 18:12:38 UTC