Re: [csswg-drafts] [css-text-3] letter-spacing computed values don't reflect reality

The Working Group just discussed `letter-spacing computed values don't reflect reality`, and agreed to the following resolutions:

* `RESOLVED: We have the spec say computed value of letter-spacing is absolute length.  There's a quirk to getComputedStyle where 0 serializes to normal and that doesn't extend to the computed style map`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: letter-spacing computed values don't reflect reality<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/1484<br>
&lt;dael> fantasai: property has a normal keyword that's the initial and takes  length<br>
&lt;dael> fantasai: normal is effectively 0 except in 2.1 we said normal you could adjust inter-letter spacing for justificaiton purposes. In text L3 I decided that was unnecessary restriction and we shouldn't distinguish normal and 0<br>
&lt;dael> fantasai: Spec says they're 100% eq. Since impl do normal to normal for computations we can say normal computes to normal and means 0. I don't see a significan't difference. Reason to compute through it you don't have to set a value to animate. normal to normal advantage is it's impl.<br>
&lt;dael> myles: Making sure I understand. If I animate from -5 to 5 I'll get visual flash?<br>
&lt;dael> fantasai: No, if you animate from initial value to 1em it won't animate correctly because it's a keyword.<br>
&lt;dael> myles: So that's why you unified 0 and normal?<br>
&lt;dael> fantasai: I did it because we might as well have computed value reflect what's in the engine. So at the end when you get computed you can't tell there's a normal. Interms of computed value the only observable difference is animations and transitions.<br>
&lt;AmeliaBR> FYI, In Chrome, letter-spacing: 0 computes to "normal". https://codepen.io/AmeliaBR/pen/73997f70e22754a85e0e6f83c5c1daf1?editors=1111<br>
&lt;dael> myles: okay<br>
&lt;fantasai> AmeliaBR: that's a *problem*<br>
&lt;AmeliaBR> (In Edge &amp; Firefox, it computes to 0px)<br>
&lt;dael> astearns: It's work for each engine to change from computing to normal to compute to 0. Seems like we have at least 3 engines computing to normal. I'm not sure there's enough value to justify the work.<br>
&lt;dael> fantasai: AmeliaBR points out a test case where Blink computes 0 to normal and that shouldn't happen.<br>
&lt;dael> astearns: That's a bug.<br>
&lt;dael> dbaron: My be a sign that the animation thing works.<br>
&lt;dael> astearns: And if anyone depends on that working in Chrome it might be worth the effort.<br>
&lt;dbaron> s/My/May/<br>
&lt;dael> astearns: We'd have to see if any other engine has a bug.<br>
&lt;dael> fantasai: So make the spec match impland if people come back with use cases we can change back<br>
&lt;dael> astearns: Change spec to say normal computes to normal.<br>
&lt;dael> astearns: Obj?<br>
&lt;dael> Rossen_: We resolved on this 2 weeks ago. I'm fine resolving again.<br>
&lt;dael> fantasai: Might have been a different property.<br>
&lt;dael> myles: Are we trying to change semantics or computed value?<br>
&lt;dael> astearns: Just computed. We're chaning the spec for the computed value to match impl.<br>
&lt;dael> Rossen_: And what AmeliaBR points out that chrome...edge computes to normal as well.<br>
&lt;dael> florian: Why?<br>
&lt;dael> Rossen_: The web needs to work<br>
&lt;dael> fantasai: noooooo...that's bad.<br>
&lt;dael> astearns: 0 computing to normal seems like you'd lose information.<br>
&lt;dael> florian: They do the same thing so not really...<br>
&lt;dael> Rossen_: I can fix the bug if there's a similar fix in other engines.<br>
&lt;dael> Rossen_: I'm all for resolving here. I just want to point out what the irc states about Edge  is not correct.<br>
&lt;dael> myles: I tested in webkit you set 0 and computed returns normal.<br>
&lt;dael> Rossen_: There's a codepen from AmeliaBR<br>
&lt;dael> florian: So only FF does normal to normal and 0 to 0?<br>
&lt;dael> Rossen_: Yes.<br>
&lt;dael> florian: Why????<br>
&lt;dael> astearns: Probably they mathced another engine<br>
&lt;AmeliaBR> In my testing, Edge v16 is returning 0px. So they must have changed for v17, if that's what Rossen is seeing.<br>
&lt;dael> florian: If we've got 3 engines doing it there might be a reason. A compat reason.<br>
&lt;Rossen_> dael, thank you for adding the drama in the IRC notes!!! :)<br>
&lt;dael> fantasai: Gecko hassn't changed to do this thing.  That's good enough reason to say the spec doesn't want that.<br>
&lt;dael> astearns: Edge made the change recently so Rossen_ you might be able to find out why the change was made.<br>
&lt;dael> Rossen_: I would guess interop issue. I could go through finding hte bug. We're not going to go back to be 0 and break interop to comply to the spec if the web doesn't do that.<br>
&lt;fantasai> Computing zero to 'normal' makes *no sense*<br>
&lt;dael> Rossen_: you need to lobby with Chrome and Webkit and then we'll fix.<br>
&lt;dael> astearns: The question of what normal computes to I can see the value of computing to 0 for animations. I don't think it's worth it. I don't see the value of 0 computing to normal. That seems like matching for matching<br>
&lt;dael> laim: Is normal required to be 0? You can't do smaller spacing?<br>
&lt;dael> florian: That would be a violation<br>
&lt;dael> fantasai: You could change spec to allow that. If normal computes to itself it can be different then 0. It could do what liam says and take into account optical sizes and adjust inter-letter spacing if font says that for example<br>
&lt;dael> fantasai: I don't think we have fonts that do that or impl that do that so normal and 0 are eq. but could be different.<br>
&lt;dael> florian: We're got what does normal compute to and lots of people compute to normal. 0 computing to normal is separate thing.<br>
&lt;dael> dbaron: The 0 computing to normal might happen at level of getComputedStyle<br>
&lt;dael> myles: Exactly. In our impl when we represent letter spacing it's a float. We don't store extra information to know if it was normal. It's one float until we produce the getComputedStyle and if it's 0 we write normal.<br>
&lt;dael> Rossen_: I think same for us.<br>
&lt;AmeliaBR> So "normal" would be the "used value" for a computed value of 0?<br>
&lt;dael> fantasai: That makes sense. If they want to store as a float that's fine. Computed value of 0 should be 0 and have normal compute away. Turning ino a keyword in the middle makes no sense<br>
&lt;dael> florian: Should we say in addition to normal compute to 0 resolved value may or must be normal?<br>
&lt;dael> florian: If everybody does it...<br>
&lt;dael> fantasai: Gecko isn't. If this is an impl issue where they're not storing enough information to know if it's was normal or 0 they should output 0. It just requires no special case in getComputedStyle<br>
&lt;dael> florian: There may be a set of scripts expecting it.<br>
&lt;dael> fantasai: If that script exists we can reconsider. Gecko doesn't do it.<br>
&lt;dael> dbaron: More likely is a script that looks at getComputedStyle to know if it's the initial value. It looks for normal asn says ofh that's the initial value<br>
&lt;dael> florian: If Gecko hasn't heard it's not that bad.<br>
&lt;dael> dbaron: All browsers agree is if you set nothing getComputedStyle returns normal.<br>
&lt;dael> astearns: This has taken a lot of time.<br>
&lt;dael> astearns: I suggest we resolve on computed value of normal, change the spec to say normal if the computed value of normal.<br>
&lt;dael> florian: computed value of normal is 0 [missed] for animation it's 0.<br>
&lt;dbaron> I think the best option may be to leave the spec as it is... if one of the non-Gecko browsers is willing to change.<br>
&lt;dael> astearns: Do we want impl detail of how this is stored?<br>
&lt;dael> fantasai: You can tell if you're doing that based on how it animates. It's about what computed style is. We're down to the spec if fine to say letter spacing normal computes to 0. Now we need to know if getComputedStyle value becomes the string normal and that's a web compat question.<br>
&lt;fantasai> s/value/value of zero/<br>
&lt;dael> Rossen_: Take the two issues separately. First one I think is easier. getComputedStyle value of letter spacing spec as normal should be normal. I think that's the original thing we wanted to resolve.<br>
&lt;dael> fantasai: The question was the computed value which isn't the same thing.<br>
&lt;dael> fantasai: All impl currently if you spec letter-spacing:0 they storoe computed value of 0. They may or may not return getComputedValue of 0. It may convert to normal during that call.<br>
&lt;dael> fantasai: Several impl store it as a number. Gecko makes a distinction between spec as nomrl and spec as 0.<br>
&lt;myles> dbaron: so you just have the extra bit just for getComputedStyle?<br>
&lt;dbaron> myles, I think so<br>
&lt;dael> fantasai: All impl if you spec 0 they store 0. Gecko stores normal if you spec normal. During getComputedStyle API call there are several impl that convert 0 to report at normal. Gecko returns the keyword or 0 depending on what spec.<br>
&lt;dael> florian: Ideally waht we want is everyone to converge to computing normal to 0 but there may be web compat issue on that. Maybe have people that recently changed figure out why and we can see if the web compat is managable or not.<br>
&lt;dael> myles: If we're going to resolve we shouldr esolve on what 3 or 4 browsers do.<br>
&lt;dael> florian: It's insane<br>
&lt;dael> myles: But 3 or 4 do it.<br>
&lt;dael> florian: But 4th doesn't so it's not required.<br>
&lt;myles> s/or/of/<br>
&lt;dael> Rossen_: Are you going to try and spec text that will set right expectation for authors or write academic papers.<br>
&lt;dael> florian: If we have a dependency we write that. We have a browser that doesn't do it.<br>
&lt;dael> Rossen_: Let me give an example.  If you recall the flexbox % for top and bottom padding it was done only for web compat. We want the web to work and applications to use the web.<br>
&lt;dael> fantasai: No one disagrees.<br>
&lt;dael> Rossen_: If we spec something not in any browser but FF do you expect anyone will change?<br>
&lt;dael> florian: You're making 2 arguments. The web compat I agree. The fact that FF doesn't do it we're not locked on.  I would prefer doing the sane thing if we're not locked.<br>
&lt;dael> florian: It's not necessarily a web compat problem because not everyone does the same thing. Given that we may not be stuck I'd prefer to try and do the sane thing.<br>
&lt;fantasai> Specifying 'letter-spacing: 0', having it behave as zero (observable from animations), and having getComputedStyle returning 'normal' is very weird<br>
&lt;dael> astearns: I'd like to go back to dbaron on IRC where he thinks best option is leave spec as is where computed value should be absolute lengths. I believe that would require Gecko to change to leave off the normal value, but he mentioned non-Gecko browsers would need to change.<br>
&lt;dael> astearns: I think what florian said is we need to find out if this is a web compat thing.<br>
&lt;dael> florian: Someone will h ave to change any way.<br>
&lt;dael> ??: Absent compat data engines won't change.<br>
&lt;dbaron> s/??/hober/<br>
&lt;dael> hober: Absent compelling data that one is preferable three engines win. It doesn't matter if it makes sense.<br>
&lt;tantek> can't even find a bug in bugzilla on this for compat reasons<br>
&lt;dael> hober: I don't see why we're still arguing.<br>
&lt;tantek> does this affect transitions?<br>
&lt;dael> astearns: I think we're arguing because it's a hard pill to spec behavior that we  think has no value.<br>
&lt;dael> florian: We have to add things to the spec to add the special case.<br>
&lt;dael> fantasai: I think it's not a benefit to authors that if they spec letter spacing 0 and get back normal.<br>
&lt;tantek> tangentially related: https://bugzilla.mozilla.org/show_bug.cgi?id=694834<br>
&lt;dael> dbaron: I think the other thing that makes sense it spec the computed value is a number. In getComputedStyle a computed value of 0 serializes to normal and not extend that to computed style map.<br>
&lt;dael> fantasai: If we spec this that's how we have to spec this. When you spec 0 computed is 0. It's only the getComputedStyle call that is normal. This is a resolved value quirk we have to put in. If it's not required by web compat I'd rather not do that. If this is just how people just cheated it in I'd rather not.<br>
&lt;dael> dbaron: I think hober is right. it's not worth the energy we'd need to deal witht he compat changes to fix this.<br>
&lt;dael> astearns: You're will ing the expend the energy to match?<br>
&lt;dael> dbaron: Yeah.<br>
&lt;dael> astearns: Proposal is we have spec say computed value of letter-spacing is absolute length.  There's a quite to getComputedStyle where 0 serializes to normal and that doesn't extend to the computed style map<br>
&lt;dael> astearns: Obj?<br>
&lt;dbaron> s/quite/quirk/<br>
&lt;dael> RESOLVED: We have the spec say computed value of letter-spacing is absolute length.  There's a quirk to getComputedStyle where 0 serializes to normal and that doesn't extend to the computed style map<br>
</details>


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

Received on Wednesday, 21 March 2018 16:54:27 UTC