Re: [svgwg] [svg-native] Consider supporting some subset of CSS (#658)

The SVG Working Group just discussed `Consider supporting some subset of CSS`, and agreed to the following:

* `RESOLVED: Conforming SVG Native document MUST NOT use <style> element, linked stylesheets, or style attribute.`
* `RESOLVED: Conforming SVG Native document MUST NOT use <style> element, linked stylesheets, or style attribute.`
* `RESOLVED: Conforming renderer SHOULD ignore these features (if they don't ignore, they must treat them according to full SVG spec).`
* `RESOLUTION:`
* `RESOLUTION: var() should be allowed in all presentation attributes in SVG Native`

<details><summary>The full IRC log of that discussion</summary>
&lt;krit> topic: Consider supporting some subset of CSS<br>
&lt;krit> GitHub: https://github.com/w3c/svgwg/issues/658<br>
&lt;krit> myles: Should we have some parts of CSS in SVG Native and if yes, which parts? Question is about complexity vs power of implementation.<br>
&lt;krit> myles: I have some thought about it.<br>
&lt;krit> myles: I could just start wait the discussion.<br>
&lt;krit> chris: We already have parts of CSS with the presentation attributes/properties<br>
&lt;krit> chris: keyframes and media queries are missing<br>
&lt;krit> myles: The draft currently says that style attribute and style element are forbidden<br>
&lt;krit> myles: I think there is a difference to using XML attributes and CSS properties. IMO those are different aspects<br>
&lt;krit> chris: The ways props and attires apply are different<br>
&lt;krit> myles: The attributes have a grammar that is specified in SVG and don't require a CSS parser. The style attribute does require a CSS parser.<br>
&lt;krit> AmeliaBR: Not true in SVG 2. All presentation attributes are specified by their CSS properties<br>
&lt;krit> AmeliaBR: E.g. SVG 2 would allow a comment in SVG attributes as well.<br>
&lt;krit> myles: That is one of the differences form SVG 1.1 to 2<br>
&lt;krit> myles: Should the rebase of SVG Native require a the CSS parser?<br>
&lt;krit> sairus: Could we use SVG OT as starting point?<br>
&lt;krit> myles: Talking about fundamentals: Not the properties that are supported is the current problem but the requirement of a CSS parser.<br>
&lt;krit> myles: I'd like to avoid a dependency on a CSS Parser.<br>
&lt;chris> can people hear me? I tred to speak a few times but maybe I was just being rude<br>
&lt;krit> myles: You can declare new CSS variables in style attribute but not in a. presentation attribute. If we match what browsers do it would expand it.<br>
&lt;chris> most of the differences don't add much functionality though<br>
&lt;chris> q+<br>
&lt;krit> myles: We would be adding dependency and complexity. We can already describe the set of features with presentation attributes. No need for style attribute that can clash with the other existing way.<br>
&lt;krit> AmeliaBR: You already mentioned CSS variables. So we need to use var() with a presentation attribute.<br>
&lt;krit> AmeliaBR: This is strongly recommadate in SVG OT.<br>
&lt;krit> myles: The CSS variables work  more like env()<br>
&lt;chris> q+ again<br>
&lt;krit> AmeliaBR: yes, that is right<br>
&lt;krit> AmeliaBR: That still requires CSS parsing rules for var()<br>
&lt;krit> myles: it just supports a subset and therefor  is even more restricted<br>
&lt;krit> myles: We have parts that run through CSS lever in our application but only for a few attributes.<br>
&lt;myles> s/lever/lexer/<br>
&lt;krit> myles: there are a couple of feature that are in OT that are specific to OT like color tables<br>
&lt;krit> myles: we might want to have our own subset and OT extends it.<br>
&lt;krit> sairus: We also need to consider features like variable fonts that may extend SVG OT.<br>
&lt;krit> sairus: ditto for blend with a delta specified<br>
&lt;krit> sairus: just want to mention that OT may expand SVG beyond variations<br>
&lt;krit> chris: Most of the stuff you can add to style don't add any value. Same for comments you could add.<br>
&lt;krit> chris: being able to specifying new presentation attributes and discussion around properties.<br>
&lt;krit> myles: Do you want to bring variations up for a future call?<br>
&lt;krit> sairus: yes. Agenda would be to discuss blend.<br>
&lt;chris> +1 to participatory, open ended discussion<br>
&lt;krit> sairus: If we include it to SVG what would the SVG community think about it<br>
&lt;krit> sairus: currently just a few folks involved at this point.<br>
&lt;krit> sairus: Couldn't bring it up today because I thought I didn't have a proposal.<br>
&lt;krit> AmeliaBR: might want to start a GitHub issue<br>
&lt;myles> https://github.com/w3c/svgwg/issues/677<br>
&lt;krit> krit: Does anyone think that style attribute is a must?<br>
&lt;krit> chris: Don't think so but custom properties are hard to add then<br>
&lt;krit> AmeliaBR: Even if we only do presentation attributes, which units would we allow?<br>
&lt;chris> ooh yes, calc<br>
&lt;krit> AmeliaBR: Fair to not support style initially.<br>
&lt;krit> AmeliaBR: But we should consider adding calc to the presentation attributes.<br>
&lt;krit> krit: as more features form CSS we bring up, the harder it is not to require a CSS parser/lexer<br>
&lt;krit> AmeliaBR: Only a subset of it<br>
&lt;krit> krit: Objections to not support style attribute?<br>
&lt;krit> &lt;don't hear any><br>
&lt;krit> myles: Means SVG NAtive ignores style<br>
&lt;krit> AmeliaBR: yes<br>
&lt;chris> Amelia phrased it very well<br>
&lt;krit> AmeliaBR typing the proposal...<br>
&lt;AmeliaBR> Conforming SVG Native document MUST NOT use &lt;style> element, linked stylesheets, or style attribute. Conforming renderer may ignore these features (if they don't ignore, they must treat them according to full SVG spec).<br>
&lt;chris> +1<br>
&lt;krit> myles: may may lead to diverging implementations. Can we make it a should?<br>
&lt;krit> AmeliaBR: problem is that you'd ask a full SVG implementation to differ functionality depending on the MIME type.<br>
&lt;krit> myles: I think that is what should happen.<br>
&lt;krit> myles: I don't think it increases implementation complexity.<br>
&lt;krit> myles: benefits outweight the cons.<br>
&lt;krit> AmeliaBR: you thinking from your perspective of a platform rendering implementation.<br>
&lt;chris> Good idea, but that also argues for a different MIME type<br>
&lt;krit> AmeliaBR: authoring tools want to write both formats and don't have 2 paths for export and may not want to implement switches to turn off features. Ditto for server side rasterisers.<br>
&lt;krit> myles: a server rasteriser would probably use a different implementation<br>
&lt;krit> AmeliaBR: requires the server to have 2 implementations.<br>
&lt;krit> myles: would like to hear what Adobe says to it<br>
&lt;krit> krit: For export it would probably not matter much. We already support multiple profiles.<br>
&lt;krit> AmeliaBR: Issue is import of SVG Native but has extra features. Should the implementation not import with this features?<br>
&lt;krit> Tavmjong: I don't think we would turn off features in import. We would support SVG Native as export though.<br>
&lt;krit> myles: Most common workflow is to open authoring tool: create the artwork, they would use a native file format and export to SVG Native.<br>
&lt;krit> myles: The file could then get delivered to an environment that requires SVG Native on opening.<br>
&lt;krit> myles: Authoring tool import would not matter.<br>
&lt;myles> s/not matter/not be the common case/<br>
&lt;krit> AmeliaBR: Question is about making a mandation that would require authoring tools to disable features on import.<br>
&lt;krit> sairus: For import, authoring tools could mention that there are features not support in SVG Native.<br>
&lt;krit> AmeliaBR: what about a spec that build up on SVG Native.<br>
&lt;krit> AmeliaBR: What if OT adds more features? Would SVG Native viewer ignore.<br>
&lt;krit> krit: I'd like to add, are SVG OT files no SVG Native documents since they are not using the same subset?<br>
&lt;krit> myles: I think color tables are unique in OT and would not require SVG Native additions.<br>
&lt;krit> myles: Presence of var() would be a parse failure.<br>
&lt;krit> sairus: Seems like SVG Native would be a golden goal but there would be a lot of circles around it and ppl would build on top of SVG Native but not use SVG Native.<br>
&lt;krit> AmeliaBR: the var() function would be support but w/o any way to declare a custom property<br>
&lt;chris> I agree with Sairus that SVG Native is going to need ICC colors down the road<br>
&lt;sairus> &lt;path fill="var(--color0, yellow)" d="..." /><br>
&lt;krit> myles: An SVG NAtive viewer would need to understand what var() is but uses the fall back since it doesn't know the custom property<br>
&lt;krit> sairus: fill should be yellow in a SVG Native viewer<br>
&lt;krit> AmeliaBR: that is the idea.<br>
&lt;krit> myles: When rebasing to sVG 2, would be straight forward to allow CSS variables.<br>
&lt;krit> AmeliaBR: sounds like we will support CSS but with limitations<br>
&lt;AmeliaBR> SVG 2 required CSS properties: https://svgwg.org/svg2-draft/styling.html#RequiredProperties<br>
&lt;AmeliaBR> SVG 2 required CSS features: https://svgwg.org/svg2-draft/styling.html#RequiredCSSFeatures<br>
&lt;krit> chris: What do we want browser to do. If browsers are not changing, it must be a may.<br>
&lt;krit> myles: I'd suspect browsers to use the system parser.<br>
&lt;chris> ok so far<br>
&lt;krit> AmeliaBR: we can still keep the must from my first proposal<br>
&lt;AmeliaBR> RESOLVED: Conforming SVG Native document MUST NOT use &lt;style> element, linked stylesheets, or style attribute.<br>
&lt;krit> RESOLVED: Conforming SVG Native document MUST NOT use &lt;style> element, linked stylesheets, or style attribute.<br>
&lt;AmeliaBR> Proposed: Conforming renderer SHOULD ignore these features (if they don't ignore, they must treat them according to full SVG spec).<br>
&lt;krit> AmeliaBR: we are still debating if we should ignore style attribute when present.<br>
&lt;krit> RESOLVED: Conforming renderer SHOULD ignore these features (if they don't ignore, they must treat them according to full SVG spec).<br>
&lt;krit> AmeliaBR: we can change later depending on implementers feedback.<br>
&lt;krit> AmeliaBR: Within the presentation attributes, should we support var()? calc()?<br>
&lt;krit> AmeliaBR: I;d like to start with units and percentages<br>
&lt;krit> AmeliaBR: If we remove relative values and percentages we don't need calc()<br>
&lt;krit> myles: OT allows percentages<br>
&lt;krit> AmeliaBR: disallowing font relative units makes sense since SVG Native does not have text anyway<br>
&lt;krit> AmeliaBR: percentage support depends<br>
&lt;krit> krit: var() function would be supported for all presentation attributes?<br>
&lt;krit> sairus: Right now OT should only be set on color values.<br>
&lt;krit> myles: Reason for OT was color parsing and CSS lexer in out implementation<br>
&lt;krit> myles: we might support it everywhere<br>
&lt;krit> RESOLUTION:<br>
&lt;chris> +1<br>
&lt;krit> RESOLUTION: var() should be allowed in all presentation attributes in SVG Native<br>
&lt;sairus> (sorry, had to leave – back to my team's offsite/onsite meeting)<br>
&lt;krit> trackbot, end telcon<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/658#issuecomment-489775534 using your GitHub account

Received on Monday, 6 May 2019 21:02:36 UTC