Suppress auto-hyphenation for Capitalized words [was: Don’t hyphenate proper nouns in English]
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: ragdoll, Assigned: jfkthame)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:66.0) Gecko/20100101 Firefox/66.0
Steps to reproduce:
Used hyphens: auto
on p
elements.
Actual results:
Hyphenation was turned on, but there is far too much hyphenation. In particular, proper nouns, i.e. names, get hyphenated. Some names, like Justin and Stephanie appear to not be hyphenated, but Prudence doesn’t like it when her name reads as
> Pru-
> dence
Likewise, companies don’t like it when their names that happen to use common words are broken across lines.
The only options to address the issue on the developer side are to either code in spans
that turn hyphenation off on a word-by-word basis, which is too much to ask when content is distributed among non-technical workers in a large site, or to turn off hyphenation altogether, which is always the result, because it’s the path of least resistance.
Expected results:
Proper nouns in English should never be hyphenated. If, for some reason, they do need to be hyphenated, that should be the edge case, not the other way around.
Hyphen support is uniformly bad across all browsers, but they should be progressive enhancements. As it stands, turning on hyphens degrades the quality of the content and hyphenating proper nouns is the primary reason for that.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
In general, it would be good to have more sophisticated control of hyphenation. (CSS Text 4 introduces some additional properties[1] to provide more control, but is a long way from being implemented at this point.)
Perhaps we should consider excluding capitalized words from auto-hyphenation for the time being. I suspect that would be an improvement in more cases than not.
Assignee | ||
Comment 2•5 years ago
|
||
If we do this, it'll have to be lang-specific, I think; we wouldn't want to suppress hyphenation of capitalized words in German, for example, or all its Wonderfullylongcompoundnouns will become unhyphenatable.
Assignee | ||
Comment 3•5 years ago
|
||
This affects a number of our existing reftests, so we'll need to update those
to not expect hyphenation of a sentence-initial (capitalized) word.
(Hyphenation behavior is not sufficiently well-specified for this to be tested
at the WPT level, so we just use Gecko-specific reftests.)
Updated•5 years ago
|
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a811c910cfd3 Avoid auto-hyphenating capitalized words, except for German. r=emilio,mats
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 6•2 years ago
|
||
This change has broken hyphenation in a significant number of languages other than English.
Rather than making an exception for German, please restrict this change to English only, since there seems to be a majority of languages that do want hyphenation of capitalized words.
Also, this change has also caused the first word in a sentence to not be hyphenated. You actually seem to have discovered this from tests failing and still pushed through this change. Frankly, I am astonished to see that nobody stopped to think that maybe that should be fixed.
These two issues have in combination caused a significant regression in page layout for a number of languages, particularly on mobile. With mobile traffic now making up a majority, this is only more serious. On mobile, languages like Danish, German or Finnish (among others) have a need to hyphenate their frequently longer words, capitalized or not.
Comment 7•2 years ago
|
||
Wow, this is terrible! This effectively disables auto hyphenation in the one case it really matters: titles. Titles always start with a capital letter; and since in Norwegian lots of titles can be one single compound word; you are forcing us to either always manually insert characters in all titles to not get overflow on mobile; or use break-word to mangle the title by breaking it anywhere without hypens even though if only we incorrectly wrote the word with lowercase it would be able to hyphenate it perfectly.
At least make a css option to ignore the stupid uppercase rule!
Comment 8•2 years ago
|
||
In any case; isn't it always more desirable (even in English) to hyphenate a word than to have it overflow? I would think that companies would much rather prefer to have their name hyphenated and still visible than to have half of it disappear off the page (or to have it randomly chopped to fit using word-break: break-all;)
At least make an exception to this rule if the word in question doesnt fit on the line at all without hyphenation. (And better yet, do not apply to every language in the world a fix a perceived issue only in English)
Description
•