Re: [csswg-drafts] [css-inline] A question for the procedure to compute the resolved value of "line-height" (#3749)

The CSS Working Group just discussed `resolved value of line-height`.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> Topic: resolved value of line-height<br>
&lt;Rossen_> github: https://github.com/w3c/csswg-drafts/issues/3749<br>
&lt;emilio> github: https://github.com/w3c/csswg-drafts/issues/3749<br>
&lt;emilio> AmeliaBR: what's the question to be resolved?<br>
&lt;emilio> florian: this is about the resolved value of `line-height: normal`<br>
&lt;emilio> koji: right now Blink behaves differently from Gecko / WebKit<br>
&lt;heycam> koji: one of our contributors is willing to try to change Blink<br>
&lt;heycam> koji: seems smoother for Blink to change, want to confirm that with WG<br>
&lt;fantasai> ScribeNick: fantasai<br>
&lt;fantasai> scribenick: heycam<br>
&lt;heycam> emilio: Gecko and WebKit already have this behavior since CSS 2<br>
&lt;heycam> ... CSS2 defines the used value of line-height as something based on the primary font of the element<br>
&lt;heycam> ... I did try to switch Gecko to return normal, and it's probably not impossible, but it's a bunch of work<br>
&lt;heycam> ... also mats disagreed with it<br>
&lt;heycam> florian: what CSS 2 has to say is fuzzy<br>
&lt;heycam> ... different editions<br>
&lt;heycam> ... all browsers are interoperable about what line-height:normal does, to an approximation<br>
&lt;heycam> ... that is different from what CSS 2.1 says<br>
&lt;heycam> ... 2.1 claims normal is equivalent ot a number<br>
&lt;heycam> ... that's not what everyone does<br>
&lt;heycam> ... therefore it would make sense that for resolved value, you return the word "normal"<br>
&lt;heycam> emilio: there is<br>
&lt;heycam> florian: there isn't<br>
&lt;heycam> ... there is only if the element is empty<br>
&lt;heycam> dbaron: part of the problem is we had a long discussion at Tokyo F2F about line height<br>
&lt;heycam> ... and there's nothing written down that reflects the results of that<br>
&lt;heycam> ... in a readable format<br>
&lt;heycam> ... some edits made to CSS 2 and reverted<br>
&lt;heycam> ... there's no usable reference for the results of that discussion, therefore some people involved here inlc emilio and mats, who don't know what's discussed there<br>
&lt;heycam> florian: I'm frustrated about these edits being reverted<br>
&lt;heycam> ... I'll take those edits and put them into css-inline<br>
&lt;heycam> ... skipping oer the detalis, the behavior of line-height:normal is not euivalnet to a number<br>
&lt;heycam> emilio: you copmute a number at the start of the element (and the element itself), but once you get that number, which is what Gekco and WK return from gCS, it's the same as if you use that px value ...<br>
&lt;heycam> dbaron: it's not<br>
&lt;heycam> ... there are 2 ways it's different at least<br>
&lt;heycam> koji: I think dbaron and florian are talking about how line-height:normal is laid out<br>
&lt;heycam> ... emilio is talking about how line-height is computed<br>
&lt;heycam> ... and that is interop between Gecko and WK<br>
&lt;heycam> dbaron: what florian and I are saying is that there does not exist a number or a px value that is equivalent to normal<br>
&lt;heycam> ... because depending on the text you have in the element, adn what font fallbcak occurs, you'll get different results<br>
&lt;heycam> koji: that's for layout<br>
&lt;heycam> florian: the computed value is normal as a keyword<br>
&lt;heycam> dbaron: I don't think the point you're making is relevant here, I think florian's argument is that we're looking at situations where the computed value is normal, from a style perspective<br>
&lt;heycam> ... and we're asking what resolved value to report there<br>
&lt;heycam> ... florian's point is that in most cases when we have a reoslved value, putting that resolved value back in the computed value is basically euqivalent<br>
&lt;heycam> ... so there are cases where the computed value is a % and resolved value is px<br>
&lt;heycam> ... but if you take the resolved value and put it back in computed value, you would get the same result (at least for that element, not necessarily for inheritance etc.)<br>
&lt;heycam> ... florian's point is that in this case, there is not a single number that leads to that result, because what normal does around say font fallback, looking at metrics of possibly one possibly multiple fonts, is different from what any particulra number does<br>
&lt;heycam> ... that's the stuff that is not well documented because the CSS 2.1 edits were reverted<br>
&lt;heycam> florian: the right value to return from gCS would be normal<br>
&lt;heycam> ... but if there's broad interop everywhere but Chrome, to return what that number would be if the element is empty, then that's unfortuate but not unfortunate enough to object to that<br>
&lt;heycam> emilio: I was going through the Gecko code, we have various bits of if line-height is normal, update the line<br>
&lt;tantek> reverting the 2.1 edits (there were a bunch more) was the right thing to do because none of it was based in minuted discussions nor even test cases, and that kind of editing for a stable document like 2.1 is irresponsible<br>
&lt;heycam> dbaron: there are a bunch of things in Gecko code based on line-height normal, a bunch are wrong<br>
&lt;heycam> ... some were discussed at that previous meeting,<br>
&lt;heycam> dbaron: a bunch of the conditions in the gecko code are in the wrong place<br>
&lt;heycam> ... there's a bunch of design decisions important for interactions with other features, due to hte lack of interop, we probaly still have the freedom to make<br>
&lt;heycam> emilio: after seeing our usage of line-height:normal in our layout engine, I agree that given normal is more special, the right thing to do would be to return normal<br>
&lt;heycam> ... I can try again to change Gecko, and if I can't I can report back<br>
&lt;heycam> florian: getting interop would be nice<br>
&lt;Rossen_> q?<br>
&lt;heycam> ... if the only way for that is to return a number, that's OK, otherwise let's try normal<br>
&lt;tantek> from my recollection, line-height normal was a way used (by implementation) to capture the legacy Netscape behavior of inline line layout, as opposed to what HÃ¥kon &amp; Bert wanted line-height to do<br>
&lt;heycam> myles_: philosophically returning normal would be great<br>
&lt;heycam> ... might break the web<br>
&lt;heycam> florian: chrome has been returning normal for a long time, so maybe wouldn't?<br>
&lt;heycam> ... maybe there is UA sniffing that would maek it break<br>
&lt;heycam> emilio: given this conversation I can try to convince mats<br>
&lt;heycam> florian: I will try to take the CSS 2.1 fixes and put them in Level 3<br>
&lt;heycam> emilio: notes in the spec about how that not only affects resolved value, but other stuff, would be great<br>
&lt;heycam> koji: dbaron's explanation I finally understand why we want normal, it makes sense<br>
&lt;heycam> ... but I also want interop.  is WK willing to change?<br>
&lt;heycam> myles_: I don't think I would chane this before Gecko does<br>
&lt;heycam> ... if Gecko succeeds we'd probably be willing to do it<br>
&lt;heycam> dbaron: my memory of the discussions we had in Tokyo, I'm not 100% sure we all agreed that we want to stick to a behavior that normal cannot be mapped to a number<br>
&lt;heycam> ... that number might depend on something in the first available font, it almost certianly would, but I'm not sure we agreed that we do not want hte behavior that you could'nt convert normal to an equivalent number based on available font metrics<br>
&lt;heycam> ... that is using font metrics but not particular character availability<br>
&lt;heycam> florian: how about we reopen that issue as necessary, based on the Tokyo text, which describes ~reality<br>
&lt;heycam> ... and do that based on the text<br>
&lt;heycam> myles_: are you suggesting you want to change hte behavior to make normal not magic?  or numbers be more magic?<br>
&lt;heycam> dbaron: change normal so that its magic is a bit different<br>
&lt;heycam> ... e.g. how font fallback interacts with line rhythm<br>
&lt;heycam> ... one piece there is that maybe it is better if the box that normal gives you is only a function of hte first available font, and not hte fallback fonts<br>
&lt;heycam> ... then when you have multiple lines/elements, some of which trigger fallbcak, you don't get unstable line rhythm<br>
&lt;heycam> ... I'm not sure we sorted that out fully<br>
&lt;heycam> myles_: I have opinions on this but maybe that's a different topic<br>
&lt;heycam> dbaron: the reason I'm bringing it up, is it relates to the conclusion that there does not exist an equivalent number<br>
&lt;heycam> ... but that's a full day long discussion<br>
&lt;heycam> florian: I agree there's room for discussion<br>
&lt;heycam> ... I propose we first get back the text, and go from there<br>
&lt;heycam> dbaron: sure<br>
</details>


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

Received on Wednesday, 5 June 2019 15:40:24 UTC