Re: [csswg-drafts] [css-text-decor] Underline position for when decorating box is higher than regular position (#5002)

The CSS Working Group just discussed `Underline Position for decorating box`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Underline Position for decorating box<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/5002<br>
&lt;TabAtkins> fantasai: undeline position requires udnerline to not move<br>
&lt;TabAtkins> fantasai: If the underline cuts thru text, the browser should have chosen initial position better<br>
&lt;TabAtkins> fantasai: but it shouldn't break it and shift some of them<br>
&lt;TabAtkins> fantasai: firefox avoids splitting. could be smarter about positioning, but it works<br>
&lt;fremy> q+<br>
&lt;TabAtkins> fantasai: but other browsers break the underline depending on vertical-align<br>
&lt;TabAtkins> iank_: our most recent beahvior is [missed]<br>
&lt;dbaron> s/[missed]/in Chrome Canary but not Chrome Stable/<br>
&lt;TabAtkins> iank_: I believe our current canary matches firefox in this case<br>
&lt;dbaron> iank_: When we filed this issue we were only investigating the issue.<br>
&lt;TabAtkins> iank_: We'll take the dominant baseline<br>
&lt;TabAtkins> iank_: so this should get us similar to firefox<br>
&lt;TabAtkins> fremy: our behavior we had with edge was intentional<br>
&lt;TabAtkins> fremy: woudln't break the line when the text was above the natural baseline, but would when it went lower<br>
&lt;TabAtkins> fremy: you never want underline to be striking thru text<br>
&lt;TabAtkins> fremy: but it does mean that with the new ink-skipping beahvior, it's probably not as bad to have the line go thru the text, since it doesn't visually cross it actually<br>
&lt;TabAtkins> fremy: so even tho i'd initially have said the edge behavior was what authors want, these days since we have ink-skipping the "always just use one baseline" is better<br>
&lt;TabAtkins> fremy: espeically if it's simpler and matches impls<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack fremy<br>
&lt;TabAtkins> fantasai: So fremy i think you're proposing the spec doesn't change, and we encourage that the underline doesn't move for subscripts, but instead ink-skips as normal<br>
&lt;TabAtkins> fremy: I think ink-skipping is enabled by default?<br>
&lt;TabAtkins> fantasai: there's a handful of cjk characters that don't ink-skip, becuase they caused too much<br>
&lt;TabAtkins> fantasai: but i think they're not frequently used as subscripts<br>
&lt;TabAtkins> fremy: i think the edge issue was to break the baseline if it didn't ink skip, since we do ink-skip now that's not necessary<br>
&lt;TabAtkins> fantasai: So if you turn off skipping, should the browser be shifting baselines for subscripts?<br>
&lt;TabAtkins> fremy: I vote yes<br>
&lt;TabAtkins> jfkthame: I vote no, authors ahve properties they can use to control that<br>
&lt;TabAtkins> fremy: can't do that per span, can't affect parent's position<br>
&lt;TabAtkins> iank_: waht was edge's beahvor?<br>
&lt;TabAtkins> fremy: You draw the baseline at dominant position, but i fyou have text that would cross the underline, you break it and move it down for the text<br>
&lt;TabAtkins> iank_: so this would only be when they cross the characters<br>
&lt;TabAtkins> fremy: yes<br>
&lt;TabAtkins> iank_: I checked with koji, he says he'd prefer edge's beahvior here<br>
&lt;TabAtkins> iank_: I just loaded up edge behavior, it seems resilient<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> florian: I think if the author has sub or super they need to wkr around, they can use -position to work around it<br>
&lt;TabAtkins> florian: and we have :has() now so you can do em:has(sub)<br>
&lt;TabAtkins> fremy: it might only be on one lie<br>
&lt;TabAtkins> fremy: can't guarantee positioning even with text-underline-position<br>
&lt;TabAtkins> fantasai: I think authors want either skipping character or shifting the underline, don't think they want breaking<br>
&lt;TabAtkins> iank_: i don't particiularly like current firefox impl for this case<br>
&lt;TabAtkins> edge's behavior is resilient to these situations<br>
&lt;TabAtkins> fremy: not drawing underline on characters below baseline is a risk you don't draw at all, if an entire line is subbed<br>
&lt;astearns> would prefer an implementation that would set the baseline per spec and low enough for all spans on a line<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> iank_: I think only us and gecko have this behavior. i think we'd be willing to switch to edge's<br>
&lt;TabAtkins> iank_: what do daniel or jonathan think?<br>
&lt;TabAtkins> jfkthame: seems to be that gecko's behavior (has been there for many years) is fundamentally the right thing, and i'd prefer not to change it<br>
&lt;TabAtkins> iank_: why do you think it's right?<br>
&lt;TabAtkins> jfkthame: I think when an underline is specified on an element, it should be a continuous line, it shouldn't move about for some elements<br>
&lt;dholbert> i defer to jfkthame, (&amp; haven't fully paged this topic in)<br>
&lt;TabAtkins> iank_: even if it obscures the subelements?<br>
&lt;TabAtkins> jfkthame: Sure, don't put lines on top of text, that's bad authoring<br>
&lt;TabAtkins> jfkthame: i think authors have neough control to do sensible things<br>
&lt;astearns> q+<br>
&lt;TabAtkins> iank_: I think it's quite common to get into this case<br>
&lt;TabAtkins> iank_: And to get yourself out o fit again by using additional elements<br>
&lt;TabAtkins> jfkthame: you mean common due to &lt;sub>?<br>
&lt;TabAtkins> iank_: yeah you don't need to use any css to get into this<br>
&lt;Rossen_> ack astearns<br>
&lt;florian> q+<br>
&lt;TabAtkins> astearns: jonathan, would you be at all interested to move the underlie down when there's subscript, so there's a continuous line?<br>
&lt;TabAtkins> jfkthame: i think we could consider, and think spec currently allows for that<br>
&lt;TabAtkins> jfkthame: have some hesitation - if you underline some text that's broken across several, and sub is on one line, does it get a diff position from the other lines? maybe weird, but could think about it<br>
&lt;astearns> s/there’s a continuous line/there’s a continuous line for all the spans?/<br>
&lt;TabAtkins> iank_: Yeah I think shifting the whole thing isn't a good behavior<br>
&lt;Rossen_> a?<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> iank_: I think solution is to either drop the baseline entirely or have edge html's beahvior<br>
&lt;TabAtkins> fantasai: Spec did specify that kind of auto behavior in the past<br>
&lt;TabAtkins> fantasai: for l3 we made it up to the UA<br>
&lt;TabAtkins> fantasai: there used to be text specifying to move it on a per-line basis<br>
&lt;Rossen_> ack dbaron<br>
&lt;TabAtkins> dbaron: My memory of th espec was the opposite - it spec'd moving all the lines. i think that's harder but better behavior<br>
&lt;TabAtkins> dbaron: Also, in response to jonathan, another way for authors to hit this case is variabiity between fonts<br>
&lt;TabAtkins> dbaron: can hit it on some machines but not others due to font variations<br>
&lt;TabAtkins> dbaron: so this should work well as part of css's robustness to unexpected font metrics<br>
&lt;Rossen_> ack florian<br>
&lt;TabAtkins> florian: don't remember history, but spec as is today in position and offset, has a default of auto that allows for moving it down<br>
&lt;fantasai> “In determining the position of and thickness of text decoration lines, user agents MAY consider the font sizes of and dominant baselines of children. Of course, user agents MAY ignore children in these determinations. Such an averaging is done on a line per line basis.”<br>
&lt;TabAtkins> florian: but neither speaks to per-element or per-fragment<br>
&lt;fantasai> https://www.w3.org/TR/2003/CR-css3-text-20030514/#text-decoration-overview<br>
&lt;TabAtkins> florian: so currently ambiguous.<br>
&lt;Rossen_> a?<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> florian: maybe we start with more permissive version that allows either, and revisit in a bit to see if ther'es agreement?<br>
&lt;TabAtkins> florian: could say that browsers *may* do it on per-fragment<br>
&lt;fantasai> “In determining the position and thickness of text decoration lines, user agents may consider the font sizes and dominant baselines of descendants, but for a given element's decoration must use the same baseline and thickness on each line.”<br>
&lt;TabAtkins> florian: but not obliged to if it's bad<br>
&lt;fantasai> https://www.w3.org/TR/2010/WD-css3-text-20101005/#decoration<br>
&lt;TabAtkins> iank_: So allow both edge's and firefox's rednering?<br>
&lt;TabAtkins> florian: no. say you have a subscript in a long span. on first line you have a continuous line; it might be shifted down if the sub is there.<br>
&lt;TabAtkins> florian: So shift for the entire elmenet, but allow it to be per linebox fragment. not edge html style<br>
&lt;TabAtkins> iank_: don't think it's necessarily what devs expect<br>
&lt;TabAtkins> florian: will be odd if you ahve a multiline span to see the underline shifted on lines without a sub<br>
&lt;TabAtkins> iank_: i don't think either option is good<br>
&lt;TabAtkins> iank_: Both will look visually odd<br>
&lt;TabAtkins> fremy: don't like shifting per line either<br>
&lt;TabAtkins> Rossen_: so if we move forward with florian's proposal to make spec more permissive<br>
&lt;TabAtkins> TabAtkins: ian was objecting to that, he prefers edge's behavior<br>
&lt;TabAtkins> iank_: my strong pref and i think koji's is edge's beahvior<br>
&lt;TabAtkins> florian: have we looked at what other good typography stuff has done? we're not inventing the subject<br>
&lt;TabAtkins> jfkthame: usual answer in typo is you don't do underlining<br>
&lt;TabAtkins> astearns: or you're very explicit about the effect you want<br>
&lt;TabAtkins> astearns: indesign allows you to do whatever you want with the line tool<br>
&lt;florian> s/stuff/software/<br>
&lt;TabAtkins> astearns: so we're talkign about autoamted tools<br>
&lt;ChrisLilley> *use inline svg*<br>
&lt;TabAtkins> TabAtkins: but latex is automated too<br>
&lt;TabAtkins> fremy: for latex, subs don't get an underline, and people are asking about how to get it to work<br>
&lt;TabAtkins> fremy: so as far as i can see it just doesn't draw and that's bad<br>
&lt;TabAtkins> fantasai: i'd expect that you draw the underline at correct position and skip subs, or use a lower underline position<br>
&lt;TabAtkins> fantasai: just as a document style<br>
&lt;TabAtkins> florian: alan, you said indesign will do whatever, but it does it provide a way out of the box to do like edge, or do you have to do it manually?<br>
&lt;TabAtkins> astearns: i'd ahve to check<br>
&lt;TabAtkins> fantasai: don't think i've ever seen edge's behaior in a document taht wasn't generated by a browser<br>
&lt;jfkthame> fantasai++<br>
&lt;TabAtkins> fremy: i'd assume Word does that<br>
&lt;florian> s/will do/will let you do/<br>
&lt;TabAtkins> Rossen_: that's correct<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> Rossen_: so we have a spec that describes firefox behavior<br>
&lt;TabAtkins> Rossen_: we have a strong desire from blink to ipmlemenht the Word/Edge behavior<br>
&lt;TabAtkins> Rossen_: if we need to allow both, we need at least a MAY<br>
&lt;fremy> FWIW, Word does indeed behave like EdgeHTML<br>
&lt;TabAtkins> Rossen_: so that doesn't give us much specification<br>
&lt;TabAtkins> TabAtkins: it would still help with supers to make sure that's clear<br>
&lt;TabAtkins> florian: right, still an improvement over chrome's old behavior<br>
&lt;ChrisLilley> fremy probably both usind DirectWrite api<br>
&lt;futhark> present-<br>
&lt;fremy> ChrisLilley: quite likely, indeed<br>
&lt;TabAtkins> fantasai: think i don't really want to increase variations that typographers would be unhappy abot<br>
&lt;TabAtkins> fantasai: so don't want to adopt edge's behavior unless there's typography community people wanting it<br>
&lt;TabAtkins> iank_: do we ahve evidence that people dont' want it? that' surprising to me, sicne it's in Word<br>
&lt;TabAtkins> jfkthame: Word isn't generally considered the epitome of typography<br>
&lt;TabAtkins> jfkthame: just tested Pages on Mac, if you have a sub it moves the entire line's underline<br>
&lt;TabAtkins> iank_: per line or per paragraph?<br>
&lt;TabAtkins> jfkthame: didn't go that far<br>
&lt;TabAtkins> iank_: would it help to quickly show examples?<br>
&lt;TabAtkins> iank_: [old chrome behavior, baseline jumps all over for subs and supers. consistent per individual element]<br>
&lt;TabAtkins> iank_: [firefox's behavior, underline is just dominant. ink-skipping can make it appear to not draw for subs, depending on how the glyph is]<br>
&lt;TabAtkins> iank_: [dominant baseline *per element*, so lines without a sub/super still have the underline shifted]<br>
&lt;dholbert> FWIW, LibreOffice seems to match the EdgeHTML behavior (not that LibreOffice is necessarily the pinnacle of text layout; just as another-agreeing-implementation)<br>
&lt;TabAtkins> florian: I checked apple pages, it shifts per line, not per paragraph<br>
&lt;emeyer> q+<br>
&lt;TabAtkins> iank_: [Edge's behavior - underline is dominant, but subs break it and draw their own underline fragment to their dominant baseline. supers don't affect the underline]<br>
&lt;TabAtkins> fantasai: I think firefox's behavior is closest to what i'd expect form good typog<br>
&lt;emeyer> q-<br>
&lt;fantasai> emeyer: I agree<br>
&lt;TabAtkins> florian: firefox beahvior could be made smarter<br>
&lt;dbaron> s/typog/typography/<br>
&lt;dbaron> s/form/from/<br>
&lt;TabAtkins> fantasai: and i'd expect ink-skipping with a consisten tposition to look best<br>
&lt;TabAtkins> fantasai: if your'e not skipping, that's obvious a little bad<br>
&lt;bramus> (Sidenote for macOS users: System Preferences  > Accessibility > Zoom: hit checkbox “Use scroll gesture …” and then you can zoom in by scrolling while holding a modifier key. Don’t know if that plays nice with screen sharing though)<br>
&lt;TabAtkins> fantasai: if you have a lot of subs and supers mixed together, you should probabyl generally choose a lower underlie position<br>
&lt;TabAtkins> fantasai: I don't think I'd expect Edge's behavior from a well-typeset doc<br>
&lt;TabAtkins> iank_: is it permissible to skip a giant sub?<br>
&lt;TabAtkins> fantasai: default is ink skipping<br>
&lt;TabAtkins> iank_: I mean skip entirely, not just ink-skip<br>
&lt;ChrisLilley> s/en tpos/ent pos/<br>
&lt;TabAtkins> iank_: ink skipping works for shorter cases, like this small B sub<br>
&lt;TabAtkins> iank_: but the big edge case is a long subscript<br>
&lt;TabAtkins> fantasai: we should be optimizing for reasonable cases<br>
&lt;TabAtkins> several: nah we've seen long subs<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> fantasai: i think standard will be short subscripts and we should optimize for that<br>
&lt;ChrisLilley> ironic typography<br>
&lt;TabAtkins> fantasai: there has been requests to turn off underline for an element, that's an open Text 4 request<br>
&lt;TabAtkins> fantasai: so if someone wanted to skip, that should be posible to spec<br>
&lt;TabAtkins> una: i noticed if you have a sub that's a link, that's common, it'll have a double underline - parent going thru it, then its underline<br>
&lt;TabAtkins> fantasai: yeah edge behavior gives you multiple, but spec behavior is to have one single line that doesn't move<br>
&lt;bkardell_> I was saying that I agree it is unusual for a long run of text as a subscript in general, but a lot of times superscripts are links, which generally are underlined<br>
&lt;TabAtkins> fantasai: so per spec you wouldn't have double underline<br>
&lt;TabAtkins> Rossen_: [shows Word with a bunch of different font-size subs, generating multiple staggered underlines]<br>
&lt;TabAtkins> Rossen_: this example where you break the first line for a subscript out of the larger set font<br>
&lt;fantasai> [changing the baseline position breaks the underline averaging segments in Word]<br>
&lt;TabAtkins> florian: I think this is different and more complex than what was described as edge behavior<br>
&lt;TabAtkins> florian: you're saying we ahve one continuous underline until we hit the sub, then it changes after th esub?<br>
&lt;TabAtkins> fantasai: that's because word doesn't have a nesting hierarchy, it's just a linear stream of elements. so it can't preserve across a sub break<br>
&lt;astearns> InDesign also does not have a hierarchy of elements. So I don’t think we should follow InDesign OR Word<br>
&lt;TabAtkins> florian: I think LibreOffice does the edge behavior but people are asking how to not do that on SE<br>
&lt;fantasai> s/preserve/preserve formatting/<br>
&lt;TabAtkins> fremy: I cared strongly when this was first filed because we didn't have agreement, but less now<br>
&lt;TabAtkins> fremy: I think Edge's behavior is safe, but if we think it's reasonable to cross the text and rely on ink skipping, i think it's an option. i don't think it's best but i'd be okay with it<br>
&lt;fantasai> s/agreement/ink skipping/<br>
&lt;TabAtkins> iank_: I want to talk with koji to see what he'd think about, not just ink skipping but totally skipping the sub; would be identical in common cases but different in the degenerate long-text case<br>
&lt;TabAtkins> fremy: only downside is it's entirely accidental if the whole text is subbed<br>
&lt;TabAtkins> fantasai: agree it shouldn't be defualt, author should opt in maybe<br>
&lt;TabAtkins> iank_: i'd agree<br>
&lt;TabAtkins> iank_: ink skipping doesn't necessarily get a good effect, it still looks like text is crossed out<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> Rossen_: so it sounds like firefox's behavior is still something we want to keep<br>
&lt;TabAtkins> Rossen_: strong desire from ian and team to experiement and see if they can get something closer to Edge behavior<br>
&lt;TabAtkins> Rossen_: q is how do we allow it<br>
&lt;emeyer> q+<br>
&lt;TabAtkins> fantasai: i don't think this is good to adtop unless people other than browser eng want it<br>
&lt;TabAtkins> fremy: Well Word is doing it and people use it every day<br>
&lt;TabAtkins> florian: I just went to Word support forum and answer for if you want to do another behavior is "use more advanced typesetting software"<br>
&lt;florian> https://answers.microsoft.com/en-us/msoffice/forum/all/underline-subscript-is-uneven/786e1222-87c4-4dc9-97de-83b3a08a32d8<br>
&lt;TabAtkins> fantasai: I want somebody specializing in good typog to say "Word behavior is good and waht we want"<br>
&lt;TabAtkins> fremy: yeah but usual policy is to say eve if layout is weird, text should be readable<br>
&lt;TabAtkins> fantasai: we try to make sure behavior is good by defualt, and resilient in weird. doesn't mean we choose bad beahvior because it's th emost straightforward way to be resilient<br>
&lt;Rossen_> ack emeyer<br>
&lt;TabAtkins> emeyer: from what i remember of edge and firefox cases, i do not see why we'd pick Edge over Firefox<br>
&lt;TabAtkins> emeyer: what firefox was doing for ink skipping and various cases seemed like a better approach on balance<br>
&lt;astearns> I dislike Edge’s behavior because it does two different things depending on whether a line starts with a span shifted up or shifted down relative to the rest of th eline<br>
&lt;TabAtkins> emeyer: i'm not a typog expert, but i spent a lot of time looking at text<br>
&lt;TabAtkins> emeyer: I'd be comfortable asking the wider community<br>
&lt;TabAtkins> emeyer: I agree with elika, we're trying to make typog better, let's actually make it better<br>
&lt;una> q?<br>
&lt;TabAtkins> una: do we want to do a survey?<br>
&lt;TabAtkins> una: my team can organize it<br>
&lt;TabAtkins> emeyer: would support it<br>
&lt;TabAtkins> Rossen_: would be helpful<br>
&lt;TabAtkins> ChrisLilley: should be clear it's "what do you want to see" not just "what does your software do"<br>
&lt;TabAtkins> fantasai: "what do you like better: picture, picture, picture"<br>
&lt;TabAtkins> florian: Also with short sub we seem to agree firefox is good, only for long do we disagree<br>
&lt;TabAtkins> florian: Isn't it pref to use the spec allowance to move the entire line down?<br>
&lt;TabAtkins> iank_: I think there's three options here<br>
&lt;TabAtkins> iank_: First is firefox's, for short subs ink-skipping makes it readable<br>
&lt;TabAtkins> iank_: Second is Edge, where subs move the line down<br>
&lt;TabAtkins> iank_: Third is don't draw the underline on subs at all<br>
&lt;fantasai> Fourth is move the line down<br>
&lt;TabAtkins> iank_: This has similar practical behavior ot Firefox's for short; for long it will be different<br>
&lt;Rossen_> For the record - neither of the answers posted by florian's link above are official Microsoft answers but folks from the community<br>
&lt;TabAtkins> florian: Think there's four - largely do firefox, but allow for shifting the whole run's underline, perhaps with a guard to ony do it when it's long<br>
&lt;TabAtkins> fantasai: don't think it's great, it's unpredictable then<br>
&lt;TabAtkins> fantasai: if you have five subs, two on a line skip but three shift, that's weird<br>
&lt;TabAtkins> fantasai: should pick one behavior, author can get other behaviors<br>
&lt;TabAtkins> Rossen_: we can decid enot to change<br>
&lt;TabAtkins> florian: i said my fourth was possibly conditional. if it's not conditional, it matches apple<br>
&lt;florian> s/apple/Apple Pages/<br>
&lt;TabAtkins> Rossen_: so we can't get resolution yet.<br>
&lt;TabAtkins> Rossen_: We want to do a survey that catches all the cases we just described, carefully not conditioning people to one tech or another<br>
&lt;TabAtkins> fantasai: I suggest me and Una work on this<br>
&lt;TabAtkins> Rossen_: And I think convo captures enough info for posterity<br>
&lt;fantasai> ACTION: fantasai and Una to make a survey about underlining subscripts<br>
&lt;TabAtkins> Rossen_: and strong desires of what we believe is good<br>
&lt;TabAtkins> Rossen_: anything else before we end?<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> Rossen_: so let's close the issue<br>
&lt;TabAtkins> &lt;br dur=1hr><br>
</details>


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 1 August 2022 16:27:00 UTC