W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2018

Re: [csswg-drafts] [css-text] Prevent line breaking after explicit hyphens (#3434)

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Thu, 20 Dec 2018 03:42:21 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-448852068-1545277340-sysbot+gh@w3.org>
> his commit contains a typo

Fixed in ecc7db8f62175d6ffff13b78171669ee38b44bcb. Thanks.

> I am also somewhat concerned that this only begins to define what a “hyphenation opportunity” is not, rather than what it is.

Right, I agree the current text is still a bit hand-wavy about hyphenation opportunities. I thought it was worth lifting this particular ambiguity anyway, even if we later want to revisit to make the whole definition clearer, as that's where confusion has been. If you've got a suggestion for a complete rephrasing, I'm all ears.

----
I think cases like T-shirt or e-mail can be covered by the UA with the specification as it is, since the specification does not mandate that the break-after (BA) unicode line-breaking class be always respected, and so the UA could decide that (in English?) hyphen-minus should not introduce a wrapping opportunity when it is preceded by only one letter. Currently, Chrome and Safari do not do that, but Firefox does, as can be seen in this little demo: https://jsbin.com/hoqufobeje/edit?html,css,output.

Maybe we want to mandate that behavior specifically, but I suspect not, as such rules probably need to be language dependent (not to mention full of corner cases), and researching line-breaking best practices in all of the world's languages is beyond the scope of what we can hope to do in this specification. Maybe an note? Or, given that the spec already expects UAs to "do the right thing" for each language, even if the rules aren't spelled out explicitly, maybe the spec as it is is sufficient to consider that disallowing a break after the hyphen in “e-mail” is already must-do, and I can write a [wpt](https://github.com/web-platform-tests/wpt) test to check if it is being done.

----

As for the rest, yes, I'm with you. The links/quotes you gave show that there are situations where it's not desired to break after a hyphen. Since it's not universal, I don't think it would be the default, but a `hyphens: nowrap`  value, which would turn off hyphenation AND wrapping opportunities after hyphens, seems to be a very reasonable possibility to me.


-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3434#issuecomment-448852068 using your GitHub account
Received on Thursday, 20 December 2018 03:42:22 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:41 UTC