You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
topic: formsForms and form controls: input types, submission, constraint validation and autofilltopic: renderingHow elements are expected to render: the user agent style sheet
Three years later, and the situation originally described in that 2012 blog post hasn't changed:
<select>
<button>
IE 11
none
inherit
IE 6
none
inherit
Edge 18
none
inherit
Edge 15
none
inherit
Chrome 74
none
none
Chrome 37
none
none
Safari 12
none
none
Safari 4
none
none
Firefox 67
inherit
inherit
Firefox 11
inherit
inherit
A quick look through some popular "CSS normalization" projects turns up text-transform: none in three different places: normalize.css, sanitize.css, and marx.
@dbaron you've been nominated to weigh in on this from Gecko's perspective. Would you mind letting us know what you think of disabling text-transform for these elements?
I guess it seems fine to have text-transform: none on button and select. In Gecko it was originally there for input and textarea so that what users typed in text inputs didn't get transformed (see commit and bug), but since input is so many things it was broader than that. Given that breadth, it seems fine to extend to button and select if that helps compatibility.
Also, there are other non-replaced elements that reset some styles, such as table sets text-indent: initialper spec.
So I think the question is: do we want to minimize the properties for button (like Firefox), or take the shortest path to interop? I don't have a strong opinion, but since interop is the main motivation for this change, it would be bad to end up with 2 engines making changes and 1 engine still being different.
log: font-family: a abbr address area article aside audio b base bdi bdo blockquote body br canvas caption cite col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img ins label legend li link main map mark menu meta meter nav noscript object ol optgroup option output p param picture progress q rp rt ruby s script section slot small source span strong style sub summary sup table tbody td template tfoot th thead time title tr track u ul var video wbr autonomous-custom-elements applet acronym bgsound dir frame frameset noframes isindex menuitem nextid noembed rb rtc strike basefont big blink center font marquee multicol nobr spacer
log: letter-spacing: button input select textarea keygen
log: word-spacing: button input select textarea keygen
log: text-transform: button input select textarea keygen
log: text-indent: button input rt ruby select textarea keygen
log: text-shadow: button input select textarea keygen
log: color: html input mark textarea keygen
log: text-align: input select textarea keygen marquee
(Not sure why WebKit gives that result for font-family... Edit: filed w3c/csswg-drafts#4192 )
Changing things in the UA stylesheet comes with the risk of regressing rendering in existing Web content. Therefore, I would suggest taking the shortest path to interop, unless there is evidence that a different change is low risk or all implementers are on-board with the change.
@MatsPalmgren , do you still disagree with this? Although button isn't a replaced element, it still has various "magic" behaviors, and these properties being reset can be explained by that being what legacy implementations do. (Similarly for table and text-indent.)
Both Gecko and EdgeHTML inherit text-transform by default for <button> which demonstrates that this is web-compatible. That said, I guess I can live with the suggested UA rules in the interest of standardizing something.
topic: formsForms and form controls: input types, submission, constraint validation and autofilltopic: renderingHow elements are expected to render: the user agent style sheet
Activity
SimonSapin commentedon May 24, 2016
See also https://www.tjvantoll.com/2012/07/10/default-browser-handling-of-the-css-text-transform-property/
zcorpan commentedon May 24, 2016
So... what do we want for
buttonandselect?SimonSapin commentedon May 24, 2016
According to the blog post linked above that’s where there is currently no interop. I don’t have an opinion.
CC @Manishearth, @Ms2ger
domenic commentedon May 24, 2016
Being consistent across all form fields seems nicer, if we have the option.
zcorpan commentedon May 24, 2016
Yeah, that's also what people decided for normalize.css.
Manishearth commentedon May 24, 2016
I'd like to be uniform too. @annevk thoughts on changing Firefox's user-agent CSS?
Otherwise, we could add a non-normative suggestion for button and select.
jdm commentedon May 24, 2016
Related to #1046.
annevk commentedon May 24, 2016
@dbaron should probably decide on this for Gecko. Seems fine to me.
jugglinmike commentedon May 30, 2019
Three years later, and the situation originally described in that 2012 blog post hasn't changed:
<select><button>A quick look through some popular "CSS normalization" projects turns up
text-transform: nonein three different places: normalize.css, sanitize.css, and marx.@dbaron you've been nominated to weigh in on this from Gecko's perspective. Would you mind letting us know what you think of disabling
text-transformfor these elements?dbaron commentedon Jun 3, 2019
I guess it seems fine to have
text-transform: noneonbuttonandselect. In Gecko it was originally there forinputandtextareaso that what users typed in text inputs didn't get transformed (see commit and bug), but sinceinputis so many things it was broader than that. Given that breadth, it seems fine to extend tobuttonandselectif that helps compatibility.Do not cascade text-transform on form controls
Do not inherit text-transform on form controls
Do not inherit text-transform on form controls
3 remaining items
tkent-google commentedon Jun 12, 2019
IMO, it's ok to remove
text-transform:nonefrom<button>.zcorpan commentedon Jun 18, 2019
@hober can you comment on whether this change (remove
text-transform:nonefrom<button>in the UA stylesheet) is OK for webkit?rniwa commentedon Jun 18, 2019
Hm... WebKit also applies a bunch of other styles to
button:zcorpan commentedon Jun 20, 2019
Yes, indeed.
Firefox has
text-indent: 0which matches what is currently in the spec, but also sets some other properties likewhite-space,line-height,color...https://dxr.mozilla.org/mozilla-central/source/layout/style/res/forms.css?rev=e56017a57ea7#632
Also, there are other non-replaced elements that reset some styles, such as
tablesetstext-indent: initialper spec.So I think the question is: do we want to minimize the properties for
button(like Firefox), or take the shortest path to interop? I don't have a strong opinion, but since interop is the main motivation for this change, it would be bad to end up with 2 engines making changes and 1 engine still being different.zcorpan commentedon Aug 13, 2019
Test for text-transform and text-indent for all elements, to find which elements are reset in the UA stylesheet in different browser engines:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/7113
zcorpan commentedon Aug 13, 2019
OK here's a test that tests more properties, but only outputs cases where the UA style is "initial"
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/7115
Blink
Gecko
WebKit
(Not sure why WebKit gives that result for
font-family... Edit: filed w3c/csswg-drafts#4192 )zcorpan commentedon Aug 13, 2019
Changing things in the UA stylesheet comes with the risk of regressing rendering in existing Web content. Therefore, I would suggest taking the shortest path to interop, unless there is evidence that a different change is low risk or all implementers are on-board with the change.
(Let's ignore
keygenfor the purpose of this issue, on the assumption that it will be removed from WebKit eventually. https://bugs.webkit.org/show_bug.cgi?id=167018 )(I will also ignore
rtandrubyfor now, as those have special behavior per https://drafts.csswg.org/css-ruby/ and I don't want to analyze how that interacts with UA styles right now.)The shortest path to interop, for each property, I think is something like this:
(proposal)
zcorpan commentedon Aug 13, 2019
For clarity, the proposal in CSS is
@MatsPalmgren , do you still disagree with this? Although
buttonisn't a replaced element, it still has various "magic" behaviors, and these properties being reset can be explained by that being what legacy implementations do. (Similarly fortableandtext-indent.)emilio commentedon Aug 22, 2019
Note that I was abut to send a patch doing the first of them initially for https://bugzilla.mozilla.org/show_bug.cgi?id=1481112 (https://hg.mozilla.org/try/rev/680ffd20b8c7de31479bf46dc522bebec8b24d05).
MatsPalmgren commentedon Aug 22, 2019
Both Gecko and EdgeHTML inherit
text-transformby default for<button>which demonstrates that this is web-compatible. That said, I guess I can live with the suggested UA rules in the interest of standardizing something.Update which properties get reset
zcorpan commentedon Aug 22, 2019
Thanks!
text-transformweb-platform-tests/wpt#17152Do not inherit text-transform (et al.) on form controls
Do not inherit text-transform (et al.) on form controls