Skip to content

[css-text] Hyphenation styling should apply to the wbr element #5972

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

Open
r12a opened this issue Feb 10, 2021 · 7 comments
Open

[css-text] Hyphenation styling should apply to the wbr element #5972

r12a opened this issue Feb 10, 2021 · 7 comments
Labels
Closed Rejected as Wontfix by CSSWG Resolution Commenter Response Pending css-text-4 i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. Testing Unnecessary Memory aid - issue doesn't require tests

Comments

@r12a
Copy link
Contributor

r12a commented Feb 10, 2021

  1. Breaking Within Words
    https://drafts.csswg.org/css-text-4/#hyphenation
    https://drafts.csswg.org/css-text-3/#hyphenation

This issue picks up from whatwg/html#6326

In HTML, ­ represents the soft hyphen character, which suggests a hyphenation opportunity.

The hyphens property description mentions ­, but doesn't mention the wbr element. I think that whenever wbr is used inside a word it should also be treated as a hyphenation opportunity. In other words, the set of things described in the spec as 'conditional' or 'soft' hyphen should include not only ­ but also wbr.

It would probably be useful to introduce ­ and wbr in the paragraph that defines a hyphenation opportunity. Or have a separate paragraph that defines what consitutes a 'soft-hyphen' (maybe better because you can then reference that definition from various places where conditional or soft hyphens are mentioned).

In addition to the hyphens property this would also apply to the hyphenate-character property (especially) and other such.

I don't expect there to be any conflict between the use of wbr in scripts like Japanese to indicate line-break opportunities between words and its use in other languages to indicate hyphenation opportunities, since the former scripts won't apply any special hyphenation behaviours.

@r12a r12a added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label Feb 11, 2021
@frivoal
Copy link
Collaborator

frivoal commented Apr 26, 2021

Depending on exactly what you mean, that seems wrong to me.

<wbr> is a soft wrap opportunity, not a hyphenation opportunity: words with a <wbr> in them are allowed to wrap at that point, but when they do, no hyphen (or language specific alternative marking) is inserted. So I disagree with the issue as it is stated here.

However:

  • Maybe we could considered adding not just &shy; but also ZWSP and <wbr> to the list of things that must cause automatic hyphenation opportunities within a word to be ignored when hyphens is auto. Not sure this is right, but not sure this is wrong either, so maybe it's worth looking into.
  • More to your point, if <wbr> either got some new HTML attribute, or some dedicated property, to make it behave like a &shy; rather than like a ZWSP, then we should honor as a hyphenation opportunity when it is in that state. However, no such thing exists as of now. I also don't think there's any practical way to distinguish <wbr> elements used within words from those used between words in order to turn this alternate behavior on automatically when <wbr> is in the right context.

@frivoal
Copy link
Collaborator

frivoal commented Dec 28, 2022

Agenda+ to propose closing as wontfix, as per the logic in the previous comment.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Hyphenation styling should apply to the wbr element, and agreed to the following:

  • RESOLVED: Close WONTFIX
The full IRC log of that discussion <emeyer> Topic: Hyphenation styling should apply to the wbr element
<florian> s/a novelty thing/novelty hyphens/
<fantasai> -> https://github.com//issues/5972#issuecomment-826582035
<emeyer> github: https://github.com//issues/5972
<emeyer> fantasai: We propose to close WONTFIX becase <wbr> is a soft-wrap but not a hyphenation opportunity
<emeyer> …HTML could extend itself to do more, but current spec is written that if that ever happens, this will all apply to that correctly
<TabAtkins> +1 to wontfix
<emeyer> RESOLVED: Close WONTFIX

@frivoal
Copy link
Collaborator

frivoal commented Jan 25, 2023

@r12a can you confirm that you are willing to accept the WG resolution?

@frivoal frivoal added Commenter Response Pending Testing Unnecessary Memory aid - issue doesn't require tests labels Jan 25, 2023
@aphillips aphillips added i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. and removed i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. labels Sep 12, 2023
@r12a
Copy link
Contributor Author

r12a commented Sep 12, 2023

is a soft wrap opportunity, not a hyphenation opportunity:

What's the rationale for concluding this? For example, if you look at the example in the HTML Standard, it would change the reading of the text if no hyphen is applied when the long 'word' is broken over a line end. (The HTML spec makes no mention of hyphenation, of course.)

If you wanted wbr to split things like URLs so that they can break across a line, but not with hyphenation, you could style the text to have hyphens:none.

I'm not strongly opposing the decision at the moment, but i'd like to create a better understanding of whether there really is a difference between the way wbr works here. Either way, it should probably be documented in one spec or another.

@r12a r12a reopened this Sep 12, 2023
@frivoal
Copy link
Collaborator

frivoal commented Sep 20, 2023

is a soft wrap opportunity, not a hyphenation opportunity:

What's the rationale for concluding this?

  • Nothing (not CSS, not HTML) define it to be a hyphenation opportunity.
  • HTML defines it as a "a line break opportunity", which is, in css-text parlance, the same thing as a soft wrap opportunity.
  • Although this is not formally defined, the conclusion from last time we looked into it was that <wbr> was basically equivalent to [U+200B](Zero Width Space), which introduces a soft warp opportunity, not a hyphenation opportunity

@frivoal
Copy link
Collaborator

frivoal commented Sep 20, 2023

If you wanted wbr to split things like URLs so that they can break across a line, but not with hyphenation, you could style the text to have hyphens:none.

<wbr> in a url will already allow breaking across the line with no hyphenation, without any added CSS, since it is a soft wrap opportunity. hyphens: none has no effect on it.

If <wbr> was a hyphenation opportunity (which it is not), hypens: none would not allow to break the line without hyphenation, it would disable the wrapping altogether. You would need to use hyphenate-character: "". But again, this is unneeded, since <wbr> is not a hyphenation opportunity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Wontfix by CSSWG Resolution Commenter Response Pending css-text-4 i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. Testing Unnecessary Memory aid - issue doesn't require tests
Projects
None yet
Development

No branches or pull requests

4 participants