Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[css-ui] 'auto' as the initial value for the 'appearance' property isn't web-compatible #1250
Comments
tabatkins
added
the
css-ui-3
label
Apr 20, 2017
frivoal
added
css-ui-4
and removed
css-ui-3
labels
May 12, 2017
frivoal
self-assigned this
May 12, 2017
|
Sorry for the slow follow up. The spec is not expected to be web compatible if used under the webkit prefix. The different prefixed version by different browsers are different from eachother, as they have a separate value for lots and lots of replaced element / form control / parts of form controls, and they all have a different non standard set of these. It's not just the values of -foo-appearance that are non standards, but the actual things they represent. Based on this, when drafting the spec for appearance, I concluded (and as far as meetings show, the CSSWG agreed) that what was currently implemented by browsers was not possible to standardize, and that we should try to build a saner thing that actually could be, so that in the long run it would take over. The result is replacing the long list of weird values with a single 'auto' value, and 'none'. Since that's not how the prefixed versions work, I am not surprised that implementing that and aliasing it to -webkit-appearance would be web incompatible. However, would it still be web incompatible if you did not alias the two? As far as I can tell, "something sane for all UAs and all platforms" and "something compatible with -webkit-appearance" are mutually exclusive goals. We could make the change you suggest ('none' as the initial value instead, and override that with 'appearance:auto' in the UA sheet for elements that have a native look), but:
If 1. isn't actually true, and that's enough to make it possible to alias appearance and -webkit-appearance and have that be web compatible, maybe it's worth the ugliness. However, I suspect that it will not and that you (unfortunately) will need to implement a both sane version of appearance, which is something like what's in the spec with more details filled in, and separately implement a -webkit-appearance that you'll be tweaking for years to come as you find more odd sites depending on yet another misunderstood aspect of it. We should totally also specify that variant, since web compat requires it, but I hope we can also provide a clean and sane path forward to authors. |
|
ping @MatsPalmgren Any opinion on the above? |
MatsPalmgren
commented
Jun 7, 2017
|
FYI, we intend to implement
Right, we didn't try that. Assuming you cascade it separately and that input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="checkbox"] {
-webkit-appearance: checkbox;
/* oops forgot to add the other properties here */
}where the used value will be Anyway, |
MatsPalmgren
closed this
Jun 7, 2017
|
Browser vendor representatives in the CSSWG, including mozilla, were very much not interested in a version of I think we need to revisit this discussion, taking into account compat data.
|
frivoal
reopened this
Jun 8, 2017
frivoal
added
the
Agenda+ F2F
label
Jun 8, 2017
|
I think it'd be good to talk about this at the upcoming paris F2F. To help, can we have:
|
|
From Mats's link in #1250 (comment) at least one of the issues we were hitting was https://webcompat.com/issues/5910 . But probably the bigger one was https://bugzilla.mozilla.org/show_bug.cgi?id=1365614 . |
karlcow
commented
Jun 8, 2017
•
|
putting the dates here. So I can give all the webcompat cases to @MatsPalmgren and @dbaron prior to the meeting. https://wiki.csswg.org/planning/paris-2017 |
Regarding this issue, the question is whether The given example it obviously wrong, as it uses input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="checkbox"] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox;
appearance: auto;
}Sebastian |
|
@karlcow CSS F2F in Paris starts tomorrow. If you haven't had the chance yet to give webcompat cases to @MatsPalmgren and @dbaron, now would be a good time. |
astearns
removed
the
Agenda+ F2F
label
Aug 1, 2017
karlcow
commented
Aug 2, 2017
|
@frivoal |
|
@karlcow I think that's not the list that we needed -- we need the list of compat problems that caused @MatsPalmgren's patch to be backed out. |
|
(And I'd also note that I'm skeptical of things being classified as a "compat problem" if they're reported by the developer of the site rather than a user of it.) |
css-meeting-bot
commented
Aug 3, 2017
|
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: CSS UI 4 and appearance<TabAtkins> ScribeNick: TabAtkins <astearns> github: https://github.com/w3c/csswg-drafts/issues/1250 <TabAtkins> Florian: There's an appearance proeprty. We started standardizing it, because a lot of people use "none" on form controls to make them styleable in CSS. <TabAtkins> Florian: This previous existed as a prefixed form in most browsers. <TabAtkins> Florian: Before stadndardization, the values other than none was a very long list of all the ways an element could look; this list was different across browsers. <TabAtkins> Florian: We concluded this was impossible to standardize, in part because many apply to pseudo-elements that other browsers don't have, as they construct form elements differently. <TabAtkins> Florian: Instead, we'd just have an "auto" value that makes form controls look like whatever they need, and a "none" value that suppresses it. <TabAtkins> Florian: We could possibly exxtend this into a small list of special values, like "button" to make it look like a native button, but so far ahve resolved not to. <TabAtkins> Florian: Now Moz said that they need to implement all of the -webkit-appearance values. <TabAtkins> Florian: I'm a little suspicious. <TabAtkins> dbaron: Not sure if that's accurate. <TabAtkins> dbaron: I think it's, *when* we implemented both appearance and -webkit-appearance, sites broke. <TabAtkins> Florian: They first said they aliased them to each other, and that broke stuff. <TabAtkins> Florian: That's expected, they're very different. <TabAtkins> Florian: They said "we need to ipmlement all the -webkit values anyway, so the simple one isn't useful to us" <TabAtkins> dbaron: Not sure that's what we said/meant. <TabAtkins> Florian: Then I'm confused and need to know what they mean. <TabAtkins> Florian: "fwiw, we intend to support -webkit-appearance with all values that Chrome supports" ~ Mats Palmgren, June 7 <astearns> comment here: https://github.com/w3c/csswg-drafts/issues/1250#issuecomment-306788821 <TabAtkins> dbaron: There are sites that specifically set "input { appearance: none; } input[type=checkbox] { appearance: checkbox; }" <TabAtkins> Florian: We did say that, if needed for webcompat, we could add a handful of required values. <TabAtkins> Florian: This is very different from adding all 50+ webkit values. <tantek> FYI: https://bugzilla.mozilla.org/show_bug.cgi?id=1368555 <TabAtkins> dbaron: If that's the case, then don't put 'appearance' in a spec ready for impl. <TabAtkins> dbaron: Otherwise people try to implement it. <fantasai> TabAtkins: Maybe have a scary notice saying this is problemantic <fantasai> Florian: I had that note. WG asked me to remove it. <tantek> see the webcompat.com URLs in the above bugzilla bug <fantasai> TabAtkins: I'm fine with putting note back <fantasai> TabAtkins: to say that we might need some values <TabAtkins> Florian: Cool. But that's different from saying we need all the webkit values. Because then we need all the webkit pseudo-elements, and I'm not speccing that. <TabAtkins> jet: Doesn't mean we might not need it. <TabAtkins> Florian: Maybe, but it'll be a huge effort. Need good proof it's needed. <fantasai> and Florian should be given a correspondingly significant budget for working on it :) <TabAtkins> TabAtkins: So suggestion: add note saying don't implement this property yet; it needs some subset of the -webkit-appearance values; impls need to tell us which subset is necessary <TabAtkins> Florian: Initial draft included the other values Edge supports for -webkit; presumably that's for compat reasons. <TabAtkins> Florian: WG told me to remove it. <TabAtkins> gregwhitworth: My recollection was a question whether it was even needed. <TabAtkins> TabAtkins: David suggested we did - his example would break checkbox rendering. <TabAtkins> dbaron: I don't know the exact details, there's so many bugs and compat stuff it'll take a while to untangle. <TabAtkins> Florian: So two options: none | auto | <non-exhaustive-list> ; or none | <exhaustive-list> <TabAtkins> fremy: Alternatiely: let it take any keyword, treat unknown ones as "auto". <TabAtkins> Florian: That doesn't match today. <TabAtkins> astearns: Why is "auto" only with non-exhaustive list? <ericwilligers> +q <TabAtkins> TabAtkins: We could put it with exhaustive, and we could omit it from the non-exhaustive list. Depends on details. <tantek> q? <astearns> ack ericwilligers <TabAtkins> fremy: If you have "div { -webkit-appearance:button}", nothing happens. But "input { -webkit-appearance: none; }" does work; using "checkbox" will work on a checkbox input, but won't turn a text input into a checkbox. <TabAtkins> ericwilligers: I heard dbaron say that if they ship appearance it'll break compat. Can we just change the name? <fremy> TabAtkins, yes <tantek> q+ to note or we go with original guidance to drop appearance from CSS UI, and let it get documented in https://compat.spec.whatwg.org/ instead (all prefix or not variants) <TabAtkins> Florian: And then we can avoid saying "none", and use "normal" instead, which sounds better. <tantek> per https://github.com/w3c/csswg-drafts/issues/1250#issuecomment-306788821 <TabAtkins> dino: Who implements unprefixed appearance? <fremy> TabAtkins, input { -webkit-apperance:none} input[type=button] { -webkit-appearance: checkbox } renders as a button <TabAtkins> Florian: Nobody that I know, but I last checked a while ago. <TabAtkins> dbaron: We tried, but backed it out before it hit stable. <TabAtkins> dbaron: It's not clear what portions of the problem were with "appearance" and which were with "-webkit-appearance". <TabAtkins> dino: I was considering implementing unprefixed with just "none" and "auto". <TabAtkins> ack tantek <Zakim> tantek, you wanted to note or we go with original guidance to drop appearance from CSS UI, and let it get documented in https://compat.spec.whatwg.org/ instead (all prefix or not <Zakim> ... variants) <TabAtkins> tantek: One of the points Mats made is that this isn't a particularly useful feature for web authors. <TabAtkins> tantek: So one proposal is just to drop it entirely. <TabAtkins> fantasai: People use it a lot. <TabAtkins> TabAtkins: I use "none" plenty to do styles on my buttons, etc. <TabAtkins> dbaron: It's not cleaer to me which of these was the good reason to back the whole thing out. <TabAtkins> dbaron: ONe of my guidelines is that if a user reports a bug, that's a compat problem; if the dev does, that's not a compat problem. <TabAtkins> dbaron: And one of them was reported by a dev, because it comes with a jsfiddle. <fantasai> s/not/not necessarily/ <fantasai> TabAtkins: That said, your example looks believable <fantasai> TabAtkins: It would be fixed by fremy's proposal <fantasai> astearns: would also be fixed by minting an entirely new property <TabAtkins> astearns: So that seems like a cleaner solution. <TabAtkins> TabAtkins: Possible conclusion, just leave this unresolved, but note the handful of possible solutions and ask impls to tell us which they want to do. <TabAtkins> Florian: Seems better than trashing it. <tantek> seems like a lot of work for very little benefit <tantek> so I question why <TabAtkins> RESOLVED: Put a note into "appearance" saying it's not ready to implement, list the possible solutions discussed here, ask impls which they want to do. <fantasai> TabAtkins: Answer to tantek's question is that people use it for useful things today <fantasai> TabAtkins: and there is no other solution for what they want today <tantek> where is the documentation of the use-case in the spec? let's drop a URL here for the minutes |
|
In Edge we do not need a behavior more complex than if (appearance == none) { A() } else { B() } anywhere but this one exception:
|
karlcow
commented
Aug 3, 2017
If you are talking about codepen stuff, it's usually me trying to reduce real issues. The backout was generated by a new issue we didn't have in webcompat (aka not reported by us). I guess we could not know about them without having the change made. When @MatsPalmgren released its build, I tested the previous issues and it was working. Before the backout (aka before the new issue) I had mentioned that for GECKO
|
|
So it looks like the options are:
Do I miss other options? Sebastian |
karlcow
commented
Aug 9, 2017
There is also option 7:
|
frivoal
added
the
Agenda+ F2F
label
Nov 3, 2017
|
I'd like to make progress on this. It seems to me that what @FremyCompany suggested in #1250 (comment) is a good way forward. We can do it "option 2" style, and accept any keyword for the I think I lean towards white-listing the things that should behave as |
MatsPalmgren commentedApr 19, 2017
https://drafts.csswg.org/css-ui-4/#appearance-switching
For this testcase, the output in the Console in Chrome, Safari and Edge is:
I think that makes it clear that the initial value for
-webkit-appearanceisnonein those UAs. I believe the initial value forappearancemust be the same.After implementing
appearanceaccording to spec in Gecko (withautoas the initial value and-webkit-appearanceas an alias) we found that this isn't web-compatible.We will now try with
noneas the initial value instead, and override that withappearance:autoin the UA sheet for elements that have a native theme in Gecko,<button> <select>etc.