Re: [csswg-drafts] [css-values][css-images] Allow trailing comma in gradient functions (and probably others) (#4968)

The CSS Working Group just discussed `#4968 Allow trailing comma in gradient functions (and probably others)`.

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: #4968 Allow trailing comma in gradient functions (and probably others)<br>
&lt;dael> github:<br>
&lt;dael> TabAtkins: I think we're good. Previous hour was great and now we have a solid proposal.<br>
&lt;dael> TabAtkins: I won't go over the whole thing, just look at issue<br>
&lt;dael> TabAtkins: One concern from emilio during conversation is, WG in general suported trailing commas. Question was how. emilio concern was wanted it at low level, pref at parser so we didn't have to rely on impl remembering to put it in every place<br>
&lt;dael> TabAtkins: At first thought it was weird and my first idea of a funct without a comma was attr and then I remembered it allows comma sep now. My idea of comma-less functions that get upgraded has happened<br>
&lt;dael> TabAtkins: Same fo rpropreties, we've upgraded to be list valued. Some like color prob won't change, but we've done this in the past. My original objection is invalid, I support em<br>
&lt;Rossen_> q<br>
&lt;Rossen_> ack fantasai<br>
&lt;dael> TabAtkins: I prop we adjust consume a declaration, a function, and a comma sep so in addition to dropping whitespace they can drop a single comma token from the end.<br>
&lt;leaverou> +1, this will also make it easier to generate CSS<br>
&lt;dael> TabAtkins: if you have a parse close to syntax this allows it anywhere without much effort<br>
&lt;dael> TabAtkins: Syntax points: consume a declaration, consume a function, and new consume a comma sep list. All have an ammendment to consume a single comma token<br>
&lt;dael> florian: Do you want to include conditional lists and selector lists?<br>
&lt;dael> TabAtkins: Yes. the comma sep list thing was for those cases. I'd then redefine those to use that parsing algo.<br>
&lt;dael> florian: I suspect compat issues for selectors but let's see<br>
&lt;dael> florian: Properties that have comma sep list space and than a value do we have those?<br>
&lt;dael> TabAtkins: Don't as far as I know but they wouldn't be covered by this change<br>
&lt;myles> q+<br>
&lt;dael> TabAtkins: Trailing comma is at the end of the entire property declaration. The algo isn't invoked for properties.<br>
&lt;plinss> q+<br>
&lt;dael> florian: Do we have prop with comma sep list / other comma sep list?<br>
&lt;dael> TabAtkins: I don't think...<br>
&lt;tantek> I'm looking forward to when we allow 2 trailing commas TBH. Maybe next year? Maybe every year we can add another optional trailing comma?<br>
&lt;dael> fantasai: / is a more binding operator. If there are properties that have inverted the order of operation that's really bad. Comma is usually lowest<br>
&lt;Rossen_> q<br>
&lt;Rossen_> ack myles<br>
&lt;dael> myles: Seems reasonable for us to have a sinlge value prop today that turns space sep tomorrow with 2 values where we wouldn't have a comma in the middle. If we allow comma in all today couldn't do that<br>
&lt;dael> myles: Larger comment is commas make sense on lists not single value<br>
&lt;dael> TabAtkins: If we change syntax from one value to two space sep a comma wouldn't interfere. We wouldn't do something like counter reset, that was a mistake<br>
&lt;dael> myles: We use spaces and commas intentionally. Blanket stating for all doesn't seem forwardlooking<br>
&lt;dael> TabAtkins: Looks forward compat. If it was a,; and than we accept a b a, is fine a b is fine<br>
&lt;faceless2_> So "display: block,;" is valid?<br>
&lt;dael> myles: Not about ambiguity, we diesgin properties and want a comma or not a comma<br>
&lt;fantasai> yes, that's Tab's proposal<br>
&lt;dael> TabAtkins: Okay. objection to that, across css comma has been consistantly sept between repetitions of a list.<br>
&lt;dael> fantasai: Not true<br>
&lt;dael> fantasai: A lot of our funct it's not a list of thing.<br>
&lt;dael> TabAtkins: That's why I said properties.<br>
&lt;Rossen_> q?<br>
&lt;dael> TabAtkins: B/c consistant meaning there and trailing comma fine at end of one element list and not going to give comma another meaning when in a trailing position i don't think it's a forward compat issue<br>
&lt;dael> plinss: In favor but one concern.<br>
&lt;Rossen_> ack plinss<br>
&lt;dael> plinss: If you say foo, and nothing. If we define the second thing gets default value and it's important there are 2 things that's broken<br>
&lt;dael> TabAtkins: We would not define a repetition can be completely empty. We don't do that today. A value and atrailing comma is single value<br>
&lt;dael> plinss: This forces us into never allowing that. Never allow blank after comma is set in stone.<br>
&lt;dael> TabAtkins: Agree<br>
&lt;dael> AmeliaBR: How effect parsing of custom properties. When do we drop the comma? could be meaningful at end<br>
&lt;dael> TabAtkins: dropped during parsing. I can see it being confusing but I'm of the opinion that if you're putting structural stuff like that in your variable I think you'd in a world of pain<br>
&lt;emilio> q+<br>
&lt;dael> AmeliaBR: Real use cases where want custom property to be a list of repetitions or a blank. In that case don't want comma where you use custom property b/c invalid if it's a blank.<br>
&lt;dael> florian: Can we make an exception?<br>
&lt;dael> TabAtkins: Doable.  A bit weird but not out of question<br>
&lt;dael> florian: Since it's a list of tokens it's a natural exception<br>
&lt;dael> AmeliaBR: Have an exception where a blank is meaningful<br>
&lt;dael> TabAtkins: That's not parser lever<br>
&lt;Rossen_> ack emilio<br>
&lt;dael> emilio: Not sure initial answer was correct. Parsing at property consumes all tokens regardless of which.<br>
&lt;dael> TabAtkins: Depends on definition. Id on't care what declarations name is while I'm consuming so parse the same and than apply grammar. I know browsers do grammer as you go but it's must simpler mental. That's why I'm okay adding a check for it it's parsed.<br>
&lt;dael> Rossen_: Time check, this will take us to the end. We have a queue and then let's see if we can end<br>
&lt;Rossen_> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to ask for comparison between the two proposals<br>
&lt;oriol> q+<br>
&lt;dael> fantasai: Wanted to ask if we weren't going to do this for everything the alternative is only where there is a list. If we drew that up what would it look like and should we compare?<br>
&lt;dael> TabAtkins: Complicated. SImpliest is # multiplier allows trailing comma. BUt anything that does commas explicitly which is a lot would not work.<br>
&lt;dael> TabAtkins: Have to go into every prop that uses commas and make sure their grammer expresses it.<br>
&lt;dael> myles: I think that makes sense. Property by property is right<br>
&lt;dael> drousso: I agree<br>
&lt;faceless2_> +1 to myles<br>
&lt;Rossen_> Zakim, close queue<br>
&lt;Zakim> ok, Rossen_, the speaker queue is closed<br>
&lt;astearns> terrible to do things property by property for authors<br>
&lt;dael> TabAtkins: Disagree b/c it's fine and reasonable to do commas at end of single in JS. Having to distinguish for a way to write it easily seems unnecessary burdon on authors<br>
&lt;myles> q+<br>
&lt;Rossen_> q?<br>
&lt;dael> florian: I don't like it for rollout, if this is centeral it is fixed once. If it's property by property a fix would end up going out in some places but not all<br>
&lt;dael> myles: Difference between css and js is parsing rule isn't different by property in js. I don't understand argument that js has it in function calls so we have it everywhere<br>
&lt;dael> TabAtkins: Not strict, but reasoning is similar<br>
&lt;dael> oriol: Ask about trailing comma. In case there's an ! and if it's before the !important or if at very end<br>
&lt;dael> TabAtkins: Before the !important. End of value space and ! flag is after that<br>
&lt;dael> TabAtkins: I'd like to prop a resolution ad see if objections.<br>
&lt;florian> +1<br>
&lt;dael> TabAtkins: Prop: I make the syntax spec changes to allow trailing commas in general module small changes around things like !imoprtant<br>
&lt;dael> Rossen_: Obj?<br>
&lt;tantek> ES also allows it in arrays e.g. test =[1,2,]<br>
&lt;dael> myles: I'm not going to object but seems wrong direction<br>
&lt;tantek> not just functions, as a correction to myles's assertion that it's only functions<br>
&lt;TabAtkins> ES allows it *everywhere* now, yeah. [1,2,], {foo,bar,}, and foo(a,b,)<br>
&lt;dael> fantasai: Alternative way forward is TabAtkins has his prop and myles if you think there's a better way you can draft a proposal and we compare<br>
&lt;tantek> Thanks TabAtkins<br>
&lt;dael> emilio: Would myles agree on functions only and decide declarations at another time?<br>
&lt;dael> myles: Yes. Commas at end of lists is valuable<br>
&lt;dael> Rossen_: TabAtkins ?<br>
&lt;dael> TabAtkins: I think myles wants opposite of emilio<br>
&lt;drousso> that's not true TabAtkins something like `let x = 2,;` is not valid<br>
&lt;drousso> it's only allowed in places where a sequence/list/"multitude" is expected<br>
&lt;dael> emilio: Can we defer deciding if we add trailing commas for all declarations and agree we do it for comma separated list and function arguments?<br>
&lt;TabAtkins> drousso: Hm, time for a new ES proposal<br>
&lt;drousso> strong disagreee<br>
&lt;dael> florian: I think iw ould object property by property<br>
&lt;dael> fantasai: I prop that TabAtkins drafts a more specific proposal and myles and emilio discuss drafting a different proposal<br>
&lt;dael> TabAtkins: myles are you okay with trailing commas on functions?<br>
&lt;dael> myles: No opinions<br>
&lt;dael> TabAtkins: Let's resolve on that<br>
&lt;dael> smfr: Lists first<br>
&lt;dael> fantasai: Let's come back with something written specifically<br>
&lt;dael> Rossen_: I think that's be best path forward. Let's nto resolve by exhaustion. TabAtkins write your proposal. emilio and myles if you want a short at your proposal go ahead and draft that.<br>

GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at using your GitHub account

Received on Friday, 8 May 2020 00:02:35 UTC