-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'd' presentation attribute: use path() function #374
base: main
Are you sure you want to change the base?
Conversation
25c0cd2
to
71900f5
Compare
@ewilligers This does not seem correct. For compatibility reasons, the |
Which implementations support a string version of the presentation attribute? Do you mean consistency with the attribute? Note we already have unitless distance attributes (width etc) that have units in their CSS presentation attributes. Attribute syntax and CSS syntax are different. |
For reference, there is discussion in the following issues:
I still strongly disagree with using But none of the other implementers have weighed in to argue for that approach, and Chrome has been shipping it following Eric's proposal. I will point out that the current state ( The proposal should probably be discussed with CSS WG as well as SVG. |
@ewilligers The change you made affects the Also, the spec text should say what happens when a @AmeliaBR I totally agree with you. IMO it is fine that Chrome starts shipping with IMO we should not make this change for SVG2 at all and instead split the |
I'd agree with @dirkschulze that there would need to be additional prose for the presentation attribute form of |
The Working Group just discussed The full IRC log of that discussion<BogdanBrinza> topic: 'd' presentation attribute notation and PR<BogdanBrinza> GitHub: https://github.com//pull/374 <BogdanBrinza> We discussed this just now and the current change introduces the CSS notation for the d attribute. For compatibility SVG attribute would need to take the string as well, not just the path function - so we'd like to ask to update the PR to capture this difference in SVG vs CSS syntax more prominently. |
@ewilligers Do we want to move this change to SVG 2.1 or rather level 1 of a path spec? |
71900f5
to
3d8486a
Compare
I have updated the pull request to describe the difference between the property and attribute syntax. |
@@ -144,7 +144,11 @@ <h2 id="syntax">Attribute syntax</h2> | |||
unitless length and angles to be used in presentation attribute while | |||
disallowing them in corresponding property values.</p> | |||
|
|||
<p class="note">Note that all <a>presentation attributes</a>, since they are | |||
<p>The <a>'d'</a> presentation attribute is an exception, it is parsed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CSS Transforms we are a little bit more verbose and explain why there are differences as well. See https://drafts.csswg.org/css-transforms/#svg-syntax I think we should be a little bit more verbose here too.
Did we agree on freezing the d
presentation attribute to the definition of SVG 1.1? No support of the additional CSS property values?
IMO we should allow all values the property has + the string value itself for backwards compatibility reasons. But I am not sure if:
- We have discussed this in the WG already and resolved to not extend the grammar
- Chrome would support the additional CSS syntax on the attribute as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess I commented here already. Still applies IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would confuse parsing too much to to allow the path()
notation inside the attribute.
That said, I don't see any reason to freeze the attribute at SVG 1.1 when it comes to path data commands. Instead, treat the attribute value as a string injected into a path()
wrapper. If we ever do add other commands, they would be valid here, too.
@ewilligers I’d love to see this in SVG. At this point I wonder if we should defer it and look at adding this to the path spec as an extension to SVG2.0. |
@dirkschulze Based on the resolutions we made in August (#320 (comment)), the revised spec would match one implementation (Chrome). Considering how eagerly anticipated it is by authors, I don't think it's appropriate to remove just yet. (But @ewilligers, any chance you could update that PR so we can land it?) |
@AmeliaBR I'd love to keep it but we need 2 implementations for transitioning the spec. Other implementations might be willing to implement it but this needs to happen before the transition. Lets discuss how we want to deal with features that have implementers feedback but no 2 implementations yet in our next WG call. |
This brings the spec, the web platform tests and the only shipping implementation (Chrome) into consistency: none | path(<string>) closes w3c#320
3d8486a
to
7d96fba
Compare
@AmeliaBR I have updated the PR with the attribute specification. |
The SVG Working Group just discussed The full IRC log of that discussion<AmeliaBR> Topic: `d` as a property (at-risk status)<AmeliaBR> github: https://github.com//pull/374 <AmeliaBR> Eric: I've updated the PR to reflect different syntax for the attribute. <AmeliaBR> Amelia: I'll try to take a look at that. <AmeliaBR> Eric: Issue for today is, can we get a second implementation in time for PR? <AmeliaBR> Tav: I'd be willing to do it for Inkscape. <AmeliaBR> Eric: Are there any polyfills? <AmeliaBR> Dirk, Tav: Not that we know of. <AmeliaBR> Amelia: The main stumbling block for implementations in browsers, I think, was discrepancy between spec and shipped implementation in Chrome. Now that is sorted, we need to poke browser tracking issues again. <AmeliaBR> Dirk: So, first step is to merge that PR to get the up-to-date spec. <AmeliaBR> ... And then we can review status again before going to proposed Rec <AmeliaBR> Resolved: Keep `d` as geometry property in SVG 2, merging the amendments previously agreed upon after review <AmeliaBR> (discussion about difficulty implementing in Inkscape) |
Inkscape master now supports the path() notation (for rendering). |
@@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
If the path data string contains no valid commands, then the behavior | |||
is the same as the <span class='prop-value'>none</span> value.</p> | |||
|
|||
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more specific what this means for the path() function please? I thing what you want to say is that the grammar would not allow path() and falls back to EBNF as specified in this spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it could be more clear. Maybe:
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the | |
<p>When <a>'d'</a> is parsed as a <a>presentation attribute</a>, | |
the entire attribute value is parsed as if it was a `<string>` wrapped with `path()` function notation. | |
The string is then parsed according to the | |
<a href="#PathDataBNF">svg-path</a> <a href="types.html#syntax">EBNF grammar</a>, | |
and not as a sequence of CSS tokens. | |
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to define the term "path data string" somewhere, since it's used a lot in the prose.
@@ -177,7 +177,7 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
</tr> | |||
<tr> | |||
<th>Value:</th> | |||
<td>none | <a><string></a></td> | |||
<td>none | path(<a><string></a>)</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to link path()
(and maybe string as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a chicken-vs-egg issue with linking to another definition. The CSS reference definition for the path function is in the motion path module, which is still WD status, and which still references SVG 1.1 as the reference definition for the path syntax.
</p> | ||
|
||
<p class="annotation"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We let the annotation in the spec for later reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It would also be helpful to extend the annotation to add a link to the resolution to use the path()
syntax.
Please check if the changes.html section needs updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments & suggested clarifications.
Sorry for how long it took to review... back to work for January!
@@ -177,7 +177,7 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
</tr> | |||
<tr> | |||
<th>Value:</th> | |||
<td>none | <a><string></a></td> | |||
<td>none | path(<a><string></a>)</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a chicken-vs-egg issue with linking to another definition. The CSS reference definition for the path function is in the motion path module, which is still WD status, and which still references SVG 1.1 as the reference definition for the path syntax.
@@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
If the path data string contains no valid commands, then the behavior | |||
is the same as the <span class='prop-value'>none</span> value.</p> | |||
|
|||
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it could be more clear. Maybe:
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the | |
<p>When <a>'d'</a> is parsed as a <a>presentation attribute</a>, | |
the entire attribute value is parsed as if it was a `<string>` wrapped with `path()` function notation. | |
The string is then parsed according to the | |
<a href="#PathDataBNF">svg-path</a> <a href="types.html#syntax">EBNF grammar</a>, | |
and not as a sequence of CSS tokens. | |
</p> |
@@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
If the path data string contains no valid commands, then the behavior | |||
is the same as the <span class='prop-value'>none</span> value.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to clarify how this fallback works in CSS terms.
Would this affect the "used value" or only the "actual value"?
Or should we match the terminology used in other shapes, e.g., "A computed value of zero for either dimension disables rendering of the element."?
(So it would be "A path data string that contains no valid commands disables rendering of the element.")
@@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span | |||
If the path data string contains no valid commands, then the behavior | |||
is the same as the <span class='prop-value'>none</span> value.</p> | |||
|
|||
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to define the term "path data string" somewhere, since it's used a lot in the prose.
</p> | ||
|
||
<p class="annotation"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It would also be helpful to extend the annotation to add a link to the resolution to use the path()
syntax.
|
||
<div class='ready-for-wider-review'> | ||
|
||
<h3 id="TheDAttribute">The <span class="attr-name">'d'</span> attribute</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this section added?
I'd prefer to stick with defining both the property and attribute syntax in one place.
They are the same value, just with special parsing rules when the value is provided as a presentation attribute.
<td>no</td> | ||
<td>N/A</td> | ||
<td><a href="https://www.w3.org/TR/2008/REC-CSS2-20080411/media.html#visual-media-group">visual</a></td> | ||
<td>yes</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've updated the Property Index to specify the type of animation, not just yes/no. There's also a "computed value" column. Which makes me realize that we never resolved #321 on what that should be (do you normalize before computed/used value?). For now:
<td>yes</td> | |
<td>as path data string</td> | |
<td>as specified</td> |
Ideally, "as path data string" would be linked to the definition of how animation works.
@@ -144,7 +144,11 @@ <h2 id="syntax">Attribute syntax</h2> | |||
unitless length and angles to be used in presentation attribute while | |||
disallowing them in corresponding property values.</p> | |||
|
|||
<p class="note">Note that all <a>presentation attributes</a>, since they are | |||
<p>The <a>'d'</a> presentation attribute is an exception, it is parsed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would confuse parsing too much to to allow the path()
notation inside the attribute.
That said, I don't see any reason to freeze the attribute at SVG 1.1 when it comes to path data commands. Instead, treat the attribute value as a string injected into a path()
wrapper. If we ever do add other commands, they would be valid here, too.
Agenda+ added so we can decide what to do with this rather old PR |
There is a minor conflict on propidx.html which looks very easy to rebase( the current version has some property deletions). |
The SVG Working Group just discussed The full IRC log of that discussion<AmeliaBR> Topic: d presentation attribute<AmeliaBR> github: https://github.com//pull/374 <AmeliaBR> krit: There's an open pull request from Eric, but it's been there for some time. <AmeliaBR> ... We discussed & made requests for changes, but Eric hasn't been able to do this. <AmeliaBR> Amelia: Someone else needs to do the edits. We have agreement on what to say. <AmeliaBR> krit: Should we be marking it as at-risk? Do we have implementations? <AmeliaBR> tav: Inkscape now supports it for rendering. <AmeliaBR> Amelia: And our agreements should match the Chrome implementaiton, so that's 2. <AmeliaBR> krit: Who wants to take over? <AmeliaBR> Amelia: I can. <AmeliaBR> Chris: I think there are only minor conflicts. <AmeliaBR> Amelia: But also need to check that our resolutions are integrated. <AmeliaBR> krit: Anything else to discuss? <AmeliaBR> Amelia: No. I'll try to do the work this week. |
What's the progress on this almost 4 years later? When does the One use case is unsetting user agent default styles using |
Can the WG make an effort to resolve this PR thats hanging now for almost 5 years? |
This brings the spec, the web platform tests and the only
shipping implementation (Chrome) into consistency:
none | path()
closes #320