New issue
Advanced search Search tips

Issue 639223 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Soft hyphens are completely broken when they fall at the end of a text node

Reported by chris.mo...@gmail.com, Aug 19 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0

Example URL:

Steps to reproduce the problem:
1. Create one or more text nodes that end with U+00AD SOFT HYPHEN (­ if you’re lazy). For example, as a part of a fancy precise TeX-like text layout algorithm with advanced hyphenation control.

A couple of easy ways:

- Wrap each syllable (with its soft hyphen after it) in a span;
- Put a comment between the soft hyphen and what comes next.

Or just programmatically create multiple adjacent text nodes. Who needs a normalised DOM tree?

What is the expected behavior?
It should behave just the same as if all the text were in one text node. Splitting a text node into multiple adjacent text nodes should never make any difference to rendering.

What went wrong?
When the soft hyphens are ending the text nodes, the line is permitted to break at that point, but the potential hyphen’s width is *always* removed from the line length—even ones that aren’t at the end of the line and are thus zero-width—and the hyphen isn’t actually drawn at the end of the line anyway. All round buggy behaviour.

Attached is a demo of the issue taken to its extreme of inserting a soft hyphen after every character. The column of text ends up effectively only 60% wide rather than 100%.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes 

Chrome version: 54.0.2832.2  Channel: canary
OS Version: 10.0
Flash Version: 

Firefox Nightly and Edge Preview are both handling it correctly. I expect older browsers without a webkit heritage to be fine also.

It’s been around for at least five years, as https://github.com/bramstein/typeset/blob/c56da3a51ab57b3c20468c0a2ff5bcc8aa9291da/examples/flatland/index.html#L227 has been having to work around the bug.
 
/soft-hyphens-at-the-end-of-text-nodes-chrome-bug.html
2.2 KB View Download
Components: -Blink Blink>Layout

Comment 2 by e...@chromium.org, Aug 19 2016

Owner: kojii@chromium.org
Status: Available (was: Unconfirmed)
Project Member

Comment 3 by sheriffbot@chromium.org, Aug 21 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by kojii@chromium.org, Aug 22 2017

Cc: kojii@chromium.org
Labels: -Pri-2 Pri-3
Owner: ----
Status: Available (was: Untriaged)
Project Member

Comment 5 by sheriffbot@chromium.org, Aug 22

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I confirm that this is still a bug, and I’d still like it to be fixed.
Status: Available (was: Untriaged)

Sign in to add a comment