Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-text-decor] Should text-decoration-skip apply to overline and line-through? #711

Closed
upsuper opened this issue Nov 15, 2016 · 29 comments
Labels
css-text-decor-3 Current Work css-text-decor-4 i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.

Comments

@upsuper
Copy link
Member

upsuper commented Nov 15, 2016

It seems currently all the usecase of text-decoration-skip: ink is about underline. It is not clear whether this should also be applied to overline and line-through. My guess is overline may want that as well, but not line-through.

cc @kojiishi @litherum

@kojiishi
Copy link
Contributor

cc @drott

@drott
Copy link
Collaborator

drott commented Nov 15, 2016

I think it makes sense for all line types and styles and giving the author the flexibility to decide. The implementation I have almost ready for Chrome does it for all line positions and styles.

@upsuper
Copy link
Member Author

upsuper commented Nov 15, 2016

That gives author flexibility, yes, but is that what author wants? I don't know. Especially if you are going to make ink the default value of text-decoration-skip like what Safari does, you would likely break every delete line badly.

@drott
Copy link
Collaborator

drott commented Nov 15, 2016

Good point, yes, I believe we can split this into two problems: What should auto do for line-through, etc. and - should skip: ink be available for all line types. For the latter, I still think it should be, while I agree with you that applying it by default to line-through for skip: auto; as a change of the default might not be desirable.

@upsuper
Copy link
Member Author

upsuper commented Nov 15, 2016

Oh, do we have auto? That could be a game changer, though, if that can provide a decent default behavior everywhere.

However, the problem may still be valid. If author decides to use a different value for underline, they would effectively need to specify the value everywhere when there is a text-decoration-line presents, otherwise they may get undesired broken line-through, or undesired non-broken underline (considering <u>some thing important <del>deleted</del></u> and <del>deleted <u>something was important</u></del>).

If that is something we want, then text-decoration-skip should probably not be inherited by default, and should be part of text-decoration shorthand.

I have no idea why text-decoration-skip is inherited currently, though. @kojiishi thoughts?

@frivoal
Copy link
Collaborator

frivoal commented Nov 16, 2016

There's no auto in the spec, either in level 3 or 4, but having one sounds like it may be a good idea. While we're thinking about how auto would work, we should probably keep in mind issue 2 or level 4, as that may also be something we can solve with auto. Or maybe not. I guess it depends how we define it.

@kojiishi
Copy link
Contributor

I have no idea why text-decoration-skip is inherited currently, though.

From what you wrote, it looks to me that it is more problematic for text-decoration-skip to apply to all decoration lines rather than it inherits?

I agree your use case of mixing underline and strikethrough is valid, and from a test, WebKit skips underlines but not strikethrough, so intentionally or not, WebKit doesn't break your use case.

@kojiishi
Copy link
Contributor

On second thought, I didn't answer to your question; do you think inherited is an orthogonal issue to this issue, or is it questionable if text-decoration-skip applies to all line types?

I think there are valid cases where inherited is useful. In some styles, underlines skipping space characters are preferred. It's probably more useful to inherit than to propagate. For object value, authors may want to underline to all images but not to other objects.

On the other hand, your use case is valid, so I'm wondering whether we should solve this by line type, or by inherited-or-not, or both.

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

From what you wrote, it looks to me that it is more problematic for text-decoration-skip to apply to all decoration lines rather than it inherits?

That really depends on how we spec it.

For example, if

  • text-decoration-skip is not inherited by default, and
  • it is part of text-decoration shorthand, and
  • we have auto value which is computed to
    • objects ink if text-decoration-line is underline, or
    • objects otherwise,

then author would just need to specify text-decoration, and this is not an issue anymore. But whether that settings would lead to other issues, I don't know.

@kojiishi
Copy link
Contributor

Sorry, I can't understand how inherited or not affects your example -- I mean, in your example, the result looks the same to me even when it inherits. Could you point out what I missed?

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

Hmmm, if text-decoration-skip is part of text-decoration, then whether it is inherited probably doesn't matter a lot. But if that way, why should we keep it inherited?

I don't think we usually mix inherited and non-inherited properties in one shorthand property. And if it is expected to be overridden whenever text-decoration is set, it seems making it not inherited makes more sense.

@kojiishi
Copy link
Contributor

kojiishi commented Nov 18, 2016

Yeah, we should probably not to inherit if it was part of the shorthand, so agree these two are linked.

I'm not sure whether one ways works better than the other, in both ways, and also not sure how much it matters to the original issue -- to help authors wanting to skip-ink for underlines but not for strikethrough.

By making not to inherit (and thus not part of the shorthand), we lose cases where authors want to specify the underline styles (space or ink) to all descendants, and cases where authors want to use different skips (usually for object?) within single underline.

These cases are not very common I guess and ok to ignore if needed, but what will authors benefit by making not to inherit (and make it part of shorthand)?

And how does it help <u>Part of underline text was <del>deleted</del></u>?

@kojiishi
Copy link
Contributor

Oh wait, commented too early, I think I understand how it help the use case, if it propagates. I think that's what you meant?

So the question is whether propagation works better than inherited or not?

@kojiishi
Copy link
Contributor

kojiishi commented Nov 18, 2016

Use case Propagation Inheritance
<u>a <del>b</del></u> Can. Can't. Possible solutions: 1) auto can solve, 2) for ink, need to change the definition or separate properties for each (hence this original topic).
Want <img class=emoji> not to skip Can't. Possible solutions: ?? Can.
Want to skip space/ink in all places Need to change all rules. Apply a rule to html.

I'd like to have more of this list. Do you have suggestions to add/change?

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

Looking at your second usecase, it seems I didn't correctly understand how text-decoration-skip is supposed to work. And now I understand why it is made inherited by default.

If text-decoration-skip affects all decoration lines drawn on the current element (the inheritance way), the first usecase is actually unresolvable. That cell should be a "can't".

@kojiishi
Copy link
Contributor

Thank you, updated.

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

I don't think using auto as a magical value which applies ink skip to underline but not to line-through is the right way to go, because that stops author from specifying any other values.

I think the two use cases outweigh the flexibility to apply ink skip on line-through. If we cannot figure out a simple way to make them work, I guess we should just say ink skip doesn't apply to line-through.

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

Another solution is, yeah, a separate property for ink skip. It seems to me you probably want ink skip to use the propagation way, but other values to use inheritance way.

@kojiishi
Copy link
Contributor

kojiishi commented Nov 18, 2016

Ok, let's try to summary possible options to solve <u>aaa<del>bbb</del></u>.

  1. Not to fix. Just heard from a Latin native that skipping ink for strikethrough is quite natural. I don't have a good sense to assert this, if we can reach consensus that this is a common understanding and commonly seen typographic tradition, this may not be an issue.
  2. Change text-decoration-skip to non-inherited, propagated property. This has pros/cons as in comment above.
  3. Change text-decoration-skip: ink only applicable to underlines/overlines. drott@ commented this will limit when authors want to skip-ink strikethrough. WebKit does this in its prefixed -webkit-text-decoration-skip.
  4. A separate property for skip ink. We can then make it to propagate, or have values for each line types. Blink/WebKit doesn't implement propagation well yet, so relying on propagation isn't easy at this moment.

Did I list all what were discussed?

@upsuper
Copy link
Member Author

upsuper commented Nov 18, 2016

I think yes.

@FremyCompany
Copy link
Contributor

(adding myself to the thread to keep track of progress)

@ebraminio
Copy link

ebraminio commented Dec 2, 2016

I just filed on http://crbug.com/670599 and found this issue by drott comment there, just want to add my use case and 2cent, I wanted to add text-decoration-skip: ink to my language Wikipedia styles but this was a deal breaker. So specially if you decide to not make text-decoration-skip: auto happen, web browsers should make text-decoration-skip: ink to act like Safari so web authors could actually use ink without breaking <s> <del>s.

@upsuper
Copy link
Member Author

upsuper commented Dec 8, 2016

Not to fix. Just heard from a Latin native that skipping ink for strikethrough is quite natural. I don't have a good sense to assert this, if we can reach consensus that this is a common understanding and commonly seen typographic tradition, this may not be an issue.

I don't quite believe you want to ship something like this by default:

ink-skip-chrome

@Crissov
Copy link
Contributor

Crissov commented Dec 8, 2016

@upsuper’s screenshot made me wonder whether there should be another value for text-decoration / text-decoration-line or new properties text-overline-position and text-line-through-position (or a compound text-decoration-position).

  • underline: Each line of text is underlined.
  • overline: Each line of text has a line over it (i.e. on the opposite side from an underline).
  • line-through: Each line of text has a line through the middle.

The most important reason (in Western typography) to desire text-decoration-skip is that underline cuts through descenders of lowercase letters (like g, j, p, q, y). However, neither overline nor line-through regularly cuts through the ascenders of lowercase letters (like b, d, f, h, [i, j], k, l, t), because overline is usually placed above the ‘H’ height of uppercase letters (without diacritic marks) and line-through is set lower than the ‘x’ height of lowercase letters to affect short ones (like a, c, e, m, n, o, r, s, u, v, w, x, z), too.

Then, this would make more sense:

s, strike, del {
    text-decoration: line-through;
    text-decoration-skip: ink;
    text-line-through-position: over; /* over unspecified “middle”, i.e. above x-height */
}

Should I move this into a new issue?

@kojiishi
Copy link
Contributor

Let's see if anyone else has options at conf call. Options from this discussion is summarized in this comment.

@upsuper:

I don't quite believe you want to ship something like this by default:

I agree.

@Crissov

Should I move this into a new issue?

Yeah, I think so.

@drott
Copy link
Collaborator

drott commented Dec 12, 2016

After reading other comments here, I am also okay with option 3 from Koji's comment.

@dbaron dbaron changed the title [css-text-decor] Should text-decoration-skip applied on overline and line-through? [css-text-decor] Should text-decoration-skip apply to overline and line-through? Dec 13, 2016
@fantasai fantasai added i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. labels Dec 14, 2016
@fantasai
Copy link
Collaborator

@Crissov Yes, well, diacritics matter, and are common in languages other than English. :) Also other scripts are more likely to have ascenders above the overline height, and would naturally want them to skip or not skip the same as descenders.

Fwiw I'm also OK with ink-skipping to not apply to line-through; I can't think of cases where it'd be appropriate for it to skip. Adding i18n in case they have input on that point.

@tabatkins
Copy link
Member

WG resolved that ink-skipping should apply to overlines as well as underlines, but not line-throughs.

@fantasai
Copy link
Collaborator

Edited.

dougt pushed a commit to dougt/chromium that referenced this issue Jan 18, 2017
Discussion resolved in WG issue tracker:
w3c/csswg-drafts#711

BUG=670599
R=kojii
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2600453003
Cr-Commit-Position: refs/heads/master@{#444343}
@r12a r12a removed the i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. label Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-text-decor-3 Current Work css-text-decor-4 i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
Projects
None yet
Development

No branches or pull requests

10 participants