- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 31 Jul 2019 16:53:59 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `Can we start ignoring CSSRule.type?`, and agreed to the following: * `RESOLVED: Do not use .type in the future` * `RESOLVED: Don't invent new .type values for future rules; recommend usage of .constructor.name` <details><summary>The full IRC log of that discussion</summary> <dael> Topic: Can we start ignoring CSSRule.type?<br> <dael> github: https://github.com/w3c/csswg-drafts/issues/4142<br> <dael> TabAtkins: Was defining @property rule. I remembered we have to register .type on the wiki page. It's a terrible pattern from the 90s. We just do strings now. Does anyone find it valuable to make the change? We deprecate .type and all new CSS rules us a placeholder value. Add a new property that exposes name of rule as a string<br> <fremy> +1<br> <dbaron> sounds like a good plan<br> <dael> TabAtkins: That's how other things work. SVG now works like this. It's easier to work with.<br> <fantasai> maybe .typeName<br> <fantasai> ?<br> <dael> TabAtkins: Objections? Anyone feel it's worthwhile to do or not and we live with current system?<br> <dael> emilio: Usually when I do CSSOM stuff I do instance of rather then checking .type. Is new prop really necessary?<br> <AmeliaBR> .constructor.name works<br> <dael> fremy: If you go across iFrames it doesn't work. Have to get constructor constrained to a string<br> <dael> TabAtkins: True<br> <dael> TabAtkins: Mostly this is just terrible smell and have to keep doing it for new rule types. Would like to stop. If we're okay with instance of and iFrames are awk. I'm okay with just saying we stop using /type and future rules get a placeholder<br> <astearns> +1 to stop using .type<br> <dael> emilio: No strong opinion. I'm happy with string API. fremy point is nice<br> <dael> fantasai: No obj to adding, but do we want everythign else to have same type or maintain pattern going forward and enoughrage string<br> <dael> TabAtkins: Biggest encouragement is make int not work<br> <dael> AmeliaBR: Do we have use counter on how often .type are being accessed?<br> <dael> TabAtkins: No. pretty certain it's non-0. Removing .type isn't needed, just leave as is as a fossil<br> <dael> AmeliaBR: I support doing what we did with SVG where new things get unknown enum and you have to figure it out with some other way. Knowing how much current enums are used we'd know how many people would lose going forward.<br> <dael> TabAtkins: They can switch for new values<br> <dael> myles: Can't you use object.constructor.name and get a string?<br> <dael> fremy: True. But then you need class for each thing you create<br> <dael> TabAtkins: We don't right now. Weird thing HTML does. We use a fresh class for new rules<br> <dael> fremy: Reasonable to me. That works for everybody. Create unknown and stop increment the counter<br> <dael> myles: RIght now all css rules have own subclasses. WOuld work.<br> <dael> TabAtkins: Okay with that. Works across iFrames. Would let us drop to tombstone .type and not use in the future<br> <dael> TabAtkins: Let's ask for resolution on that<br> <dael> Rossen_: Objections?<br> <dael> RESOLVED: Do not use .type in the future<br> <dael> myles: Should resolution say use?<br> <dael> TabAtkins: I'll clarify in the issue<br> <astearns> s/in the future/in future specifications<br> <dael> fantasai: Let's retype the resolution TabAtkins<br> <TabAtkins> RESOLVED: Don't invent new .type values for future rules; recommend usage of .constructor.name<br> <dael> AmeliaBR: Do we want to get more specific and say that any rule type that doesn't yet have a declared type value should return 0 which is the unknown rule from DOM2?<br> <dael> AmeliaBR: And with that are there any specs that declare a value and haven't been impl? Should they be included?<br> <dael> TabAtkins: The only recent one is feature values. I'm fine with it staying how it is. I don't think any new @rules other then @property<br> <dael> fantasai: Might be in future<br> <dael> TabAtkins: Yeah, but this ask was about new @rules in specs that could be changes to match resolution<br> <dael> TabAtkins: We'll find them<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4142#issuecomment-516931967 using your GitHub account
Received on Wednesday, 31 July 2019 16:54:01 UTC