Re: [css-houdini-drafts] [css-paint-api] Rename paint(name, args) to paint-name(args)

The Working Group just discussed `Paint API`, and agreed to the following resolutions:

* `RESOLVED: Paint function and custom paint function registration does not change.`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: Paint API<br>
&lt;dael> github: https://github.com/w3c/css-houdini-drafts/issues/751<br>
&lt;cbiesinger> s/cbiesinger/??/<br>
&lt;dael> leaverou: I was suggesting that since the item with the first param defines what is bieng paited it should be part of the function name. So it should be paint-blah. It reads more clearly and separates it from the arguments. Current situation is very hard to read. It makes the thing being panted the ame level of it's parameters.<br>
&lt;dael> leaverou: I think besides the ability issue, it reads much more naturally.<br>
&lt;dael> TabAtkins: We decided against the approach back when we were diong var. THe property is --foo and tha var is --foo. This is similar. If you don't have a requirement to regirester your paint functions with the name you have the same problem. If we do require it we can but that feels strange and restricts what we can do later with a sub-version of paint.<br>
&lt;dael> leaverou: Variable was defined and references in CSS. Here's it's split between CSS and JS. JS identifier with a CSS function. In var it was both in the same place. THe CSS is consistent with this.<br>
&lt;dael> TabAtkins: But one person could have written variables file. The difference of authors applies.<br>
&lt;dael> dbaron: Another issue is readability and understanding a new feature you see in code. Witht he combined name you find paint-foo and it sounds like a CSS feature but there's no search results. There's nothing that says the name is part CSS.<br>
&lt;dael> leaverou: Because it reads more naturally. YOu're saying make it unnatural so people re confused.<br>
&lt;dael> dbaron: Make it two parts so people understand. If you put them together and they look like one thing it's hard for people to recognize it's two pieces.<br>
&lt;dael> TabAtkins: When we have custom functions in CSS you can have whatever names you want with a -- at the front.<br>
&lt;dael> fremy: I agree with the point it's tricky to parse. One argument I like is auto-completion is getting surpremicy.  But I also don't like putting function in.<br>
&lt;dael> dbaron: If you want to fix the function you can do a nested function.<br>
&lt;dael> leaverou: If your paint takes functions that also have parameters you end up with lists.<br>
&lt;dael> astearns: I suggested that earlier in IRC which addresses having the function and it's elements at the same level.<br>
&lt;dael> leaverou: What if we came up with a syntax that doesn't have the nested param. What if it's a keyword.<br>
&lt;dael> astearns: I'm convinced by dbaron where if you see a function in the value of a css you should be able to search for it to figure out what it is. Having something I can google is easier then knowing some portion would need to be extracted.<br>
&lt;ChrisL> good luck searching for 'paint' though<br>
&lt;dael> leaverou: Can you imagine this argument in any other language?<br>
&lt;dael> TabAtkins: JS swallows the compat issue of user stuff and browser stuff being in the same place. WE stay away from that.<br>
&lt;dael> fantasai: None of the param to a function are attached to a name.<br>
&lt;dael> leaverou: In JS you can create your own functions.<br>
&lt;dael> dbaron: But not that you get an additional name.<br>
&lt;dael> leaverou: In CSS you don't have . notation so you can't do what JS does here.<br>
&lt;dael> TabAtkins: Exactly<br>
&lt;dael> leaverou: Only seperator we have is the hyphen.<br>
&lt;dael> TabAtkins: But it's not for separate origins thing.<br>
&lt;astearns> (my suggestion for the minutes since I emoted it before) is paint(company-logo()) and paint(chat-bubble(blue)) a terrible idea?<br>
&lt;dael> Rossen: Alright. Any more arguments?<br>
&lt;dbaron> I wonder if the first could still just be paint(company-logo)<br>
&lt;dael> leaverou: What if it remains as an argument but it's separated in another way like a /<br>
&lt;dael> TabAtkins: We don't use / unless required by parsing.<br>
&lt;dael> astearns: And anything other then nested parans would be confusing.<br>
&lt;TabAtkins> It would mean you can't create a function that returns an ident, and use that to select the paint function you want. ^_^<br>
&lt;dael> flackr: I also find it confusing because the thing you're defining is a class.<br>
&lt;dael> leaverou: That's impl detail to a CSS author.<br>
&lt;dael> fremy: I forsee it being used for [missed]. As a css author you only care what you give to the conic gradient.<br>
&lt;dael> leaverou: As a polyfill I find it harder to say you do a conic gradient and then the other arguments depend on what your arguments are.<br>
&lt;dael> leaverou: The one parans give you more places for people to screw up.<br>
&lt;dael> Rossen: There is a couple ways to go forward. Discussion is going in two parallels. We can vote to decide on one or the other or we can stop and discuss in github.<br>
&lt;dael> leaverou: might be better for people to think so if we continue in GH issue.<br>
&lt;dael> shane: I think same argument applies, this is the space where we come to agree.<br>
&lt;dael> TabAtkins: It was just brough today, though.<br>
&lt;dael> shane: Fair. But if we resolve it's not the end of the world we can revisit.<br>
&lt;dael> Rossen: True. We can look for a resolution.<br>
&lt;dael> krit: We have the paint function and a resolution for it.<br>
&lt;dael> Rossen: We want a resolution to not change so we can mark it in the issue.<br>
&lt;dael> Rossen: Before I call for a straw poll, any other closing arguments?<br>
&lt;dael> Rossen: I've heard so far strong reasons against changing and readability and usability PoV a preference toward hypenated.<br>
&lt;dael> leaverou: And for documentation. It's easier to explain that this is a new function you can use then if you use paint function the first value is fixed.<br>
&lt;dael> Rossen: Let's try to resolve by objection first.<br>
&lt;dael> Rossen: Would there be objections to not changing the Paint function and custom paint function registration<br>
&lt;dael> shane: Does anybody object to closing this issue no change?<br>
&lt;dael> RESOLVED: Paint function and custom paint function registration does not change.<br>
&lt;dael> Rossen: I would suggest continuing discussion on this.<br>
</details>


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

Received on Monday, 9 April 2018 14:54:51 UTC