Closed emilio closed 2 years ago
https://bug1501908.bmoattachments.org/attachment.cgi?id=9020530 is probably a more permanent link that the one above.
@emilio Seems a bit odd that -webkit-appearance affects the computed value of line-height
, I recall implementers (particularly Mozilla) arguing for minimal interference among properties for computed values. Is -webkit-appearance
your only example or are there more? Also, what happens if an author sets line-height
on the OPTION elements or OPTGROUP? Does it take effect or no?
@fantasai We currently have option,optgroup { line-height: normal !important; }
in our UA sheet. I'm considering changing that, but I need to reverse-engineer what other UAs do first...
We used to have the same on <select>
and when I removed the !important
part there it broke Twitter since Gecko didn't have any "treat it as normal
for themed comboboxes" code in place...
I'm all in to less interaction between properties.
Though sometimes (in particular in this case, where we need to implement this interaction because of compat), it may be easier to do at computed value time rather than at used value time.
Seems like blink's code for this is:
There's a bunch of other font controls that affect line height, looking at that file, and to:
Note that differences between computed value time line-height and used-value-time line-height special-cases are indistinguishable as of now (in theory, see https://bugs.chromium.org/p/chromium/issues/detail?id=899489).
But it's something we need to have interop on before even considering implementing these units.
Another interesting case is text autosizing, which in some browsers like WebKit affects the computed line-height, and in others like Gecko or Blink affects the used line-height.
Though I guess that also affects font-size so there's a precedent on how they should behave there.
@emilio So what do you want us to do here?
@fantasai either specifying and getting interop on when the computed value of line-height changes after-the-fact (as in the themed combobox case) and deal with it somehow in the spec, or specify that these are used value adjustments that don't affect these units (and get browsers to change that before implementing these units).
The CSS Working Group just discussed lh and rlh units and form control complications
.
Line height adjustments I'm aware of in Gecko:
<input>
elements can't have a line-height less than normal
: code, bug. Before that the min used to be 1.0 (bug, bug).line-height: normal
for themed comboboxes (html select elements with appearance: menulist
). code, bugI can look into other browsers in a bit.
The CSS Working Group just discussed lh and rlh are complicated
, and agreed to the following:
RESOLVED: browser "fixups" of line height on form controls do *not* affect lh/rlh on the element itself. Effect of fixups on lh/rlh of descendants is explicitly undefined.
https://drafts.csswg.org/css-values/#lh says:
But the computed value of line-height depends on other properties at least in some browsers, so this suddenly becomes really tricky.
For example,
<select>
's line-height computed value for comboboxes changes in WebKit and Blink tonormal
if the select is themed (based on the -webkit-appearance) property:https://crisal.io/tmp/select.html
I'm considering doing the same in Firefox in https://bugzilla.mozilla.org/show_bug.cgi?id=1501908.
In any case, the used value does definitely depend on theming of comboboxes, for example, across all browsers (see above).
How are these units supposed to work in this case? We definitely don't want values to depend on used values. We should probably specify how these adjustments work and make them work across browsers before anyone implements these units.
cc @lilles @FremyCompany @zcorpan