-
Notifications
You must be signed in to change notification settings - Fork 132
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
geometric property needs a clear & extensible name
#49
Comments
Some rough sketches of a proposal. See also the discussion from the 3 March 2016 telcon. I think there is agreement that we need distinct property names for distinct features:
I've written up notes on text path as Issue #59. This issue will focus on shape geometry. Defining shape geometry in CSS
Dealing with the DOM interfacesAll this is great and backwards-compatible if you're only looking at the declarative side. However, we also have DOM interfaces which are customized for each shape type. My approach would be to define a universal shape interface that is the union of the existing shape interfaces. The existing interface names would still exist as subclasses for backwards compatibility, but wouldn't add any unique features. The shared behavior:
Path fragments in paint serversNeed to figure out how Future wish list:The following features probably won't be in SVG 2, but should be kept in mind as features we'd like to remain compatible with:
|
I’ve got a comprehension question: You aren’t suggesting to rename the |
@prlbr No, the 'd' attribute will remain. |
Yes, we wouldn't want to change that! There is precedent for having a name mis-match between the attribute and the corresponding CSS property: the |
Thanks! |
In blink-land we are trying to decide what to do with the 'd' property. The work is done to wire up css path animations through the 'd' property, but I definitely don't want to jump the gun on the spec. Is 'd' still being proposed as an alias of a future better name, or is css path animation still up in the air (https://lists.w3.org/Archives/Public/www-svg/2016Feb/0033.html)? |
So I think I like this. It lets us somewhat explain how the different elements get rendered; rather than "based on tagname", which doesn't exist anywhere else in CSS, it's "based on 'geometry'". Which properties get used is based on the 'geometry' value, which is no different than 'display' controlling whether 'flex-basis' or 'grid-template' get used. I thus support the idea that I presume that (I'm gonna talk with Shane and pdr on Wednesday about this so we can get a unified Blink opinion.) |
I think if we can decide on a name for the property, it should be safe to implement it for And yes, I agree with @tabatkins' arguments for why it makes sense to have sub-properties for circle, rect, etc, but not for path |
For those of us in the cheap seats, is it the suggestion that And you could do something like the following?
Given all the mentioned elements are defined as "shape" in the spec, could that be an acceptable name for the property? It's a little shorter and would save some bytes. Perhaps a little more overloaded than geometry though :) |
I like 'shape', simply because it's a little shorter than 'geometry'. |
I think I avoided @BigBadaboom Your interpretation is pretty much equivalent, except that I was suggesting that we'd need to define explicit new functions to concatenate multiple shapes into a single compound path. Which keeps things straightforward at the CSS parser level and opens up the possibility that the new functions could be used in any CSS property that accepts a shape function. But that's something to explore in the advanced Paths module. |
New idea after a full night's sleep: With CSS WG approval, we could define a property All three properties would not be active on the same element, but you would often want to set We might want to rename |
Actually, I suspect we do want
I'm not intending for this property to exist as an attribute on SVG elements. They already have everything they need - The idea is that, for example,
Equivalent to |
For now, we're going to make d a presentation attribute that takes path data as a string. We're open to the above proposal, but would like to tackle that as a separate module. |
The edits to make path data a presentation attribute currently use the same
d
property name for both the shape of a<path>
element and the baseline shape of a<textPath>
. It is not currently used for other elements (such as<hatchpath>
and<stop>
elements in a<mesh>
) that use path data with thepath
attribute.This creates some concerns:
d
is not a particularly expressive property name outside the context of a particular element.d
property is being used to apply two very different features, with only the element tag name determining how (or if) the property has an effect.points
attribute of<polygon>
/<polyline>
elements, which is a natural equivalent tod
on a<path>
, is not currently reflected in CSS geometric properties.Main discussion on the www-svg mailing list starts here:
Also relevant is this discussion on the FX mailing list, regarding the
path()
function syntax, which unfortunately got broken into two threads, only the shorter of which was copied to www-svg:The text was updated successfully, but these errors were encountered: