New issue
Advanced search Search tips

Issue 671125 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Hyphenation does not apply when there is only one word in a paragraph

Reported by m...@thomasbachem.com, Dec 5 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.35 Safari/537.36

Steps to reproduce the problem:
The attached test case wants the browser to hyphenate the word "hyphenationalgorithm" in English language on macOS.

What is the expected behavior?
It should display as:

   hyphen-
   ationalgo-
   rithm

Safari & Firefox do it properly.

What went wrong?
Instead it doesn't get hyphenated at all.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 55.0.2883.35  Channel: beta
OS Version: OS X 10.11.2
Flash Version: Shockwave Flash 23.0 r0

Originating from  issue 605840  and perhaps related to  issue 668684 .
 
hyphenation.html
212 bytes View Download
Labels: M-55

Comment 2 by e...@chromium.org, Dec 5 2016

Owner: kojii@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 3 by kojii@chromium.org, Dec 6 2016

Summary: Hyphenation does not apply when there is only one word in a line (was: Newly implemented CSS hyphenation (hyphens: auto) not working properly)

Comment 4 by kojii@chromium.org, Dec 6 2016

Summary: Hyphenation does not apply when there is only one word in a paragraph (was: Hyphenation does not apply when there is only one word in a line)
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a

commit f16ecaf4fc414d951fe9b1699d96e7eba3eab13a
Author: kojii <kojii@chromium.org>
Date: Wed Dec 07 12:48:11 2016

Apply hyphenation when there is only one word in a paragraph

The logic not to hyphenate the last word in a paragraph also prevented
single word in a paragraph from being hyphenated.

This patch hyphenates the single word case, as an exception to the
orphaned word. This is the same behavior with WebKit.

This patch also fixes not to hyphenate the last word when followed by
spaces.

BUG= 671125 

Review-Url: https://codereview.chromium.org/2557643002
Cr-Commit-Position: refs/heads/master@{#436926}

[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-auto-mock-expected.html
[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-auto-mock.html
[add] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-orphaned-word-expected.html
[add] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-orphaned-word.html
[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/Source/core/layout/api/LineLayoutText.h
[modify] https://crrev.com/f16ecaf4fc414d951fe9b1699d96e7eba3eab13a/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h

Wow, really impressive how quickly you tackled this issue and  issue 671129 . Thanks a lot for your great work!
Thanks for your work on this, Koji!

> This patch hyphenates the single word case, as an exception to the
orphaned word. This is the same behavior with WebKit.

Are you sure about this? In Safari 10.0.1 on Mac, I'm seeing hyphenation in the last word whether it's the only word or not.
Attachment on my previous comment was missing a file extension. Sorry about that.
both-words-hyphenated.gif
226 KB View Download

Comment 9 by kojii@chromium.org, Dec 10 2016

#7/#8: There maybe cases where it does not work properly, but that is the intention, see https://bugs.webkit.org/show_bug.cgi?id=156803

If you see cases it does not work as intended with reproducing HTML, it'd be great to report to us/WebKit.

Comment 10 by kojii@chromium.org, Dec 10 2016

Labels: Merge-Request-56 OS-Android
Status: Fixed (was: Assigned)
Thank you for using this new feature and reporting the issue.

This is fixed in today's Canary, it'd be great if you could try your pages with Canary.

Comment 11 by dimu@chromium.org, Dec 10 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 12 by bugdroid1@chromium.org, Dec 10 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0960024d3e442a84d4a1d38a136553013635463

commit f0960024d3e442a84d4a1d38a136553013635463
Author: Koji Ishii <kojii@chromium.org>
Date: Sat Dec 10 06:54:33 2016

Merge 2924: Apply hyphenation when there is only one word in a paragraph

The logic not to hyphenate the last word in a paragraph also prevented
single word in a paragraph from being hyphenated.

This patch hyphenates the single word case, as an exception to the
orphaned word. This is the same behavior with WebKit.

This patch also fixes not to hyphenate the last word when followed by
spaces.

BUG= 671125 

Review-Url: https://codereview.chromium.org/2557643002
Cr-Commit-Position: refs/heads/master@{#436926}
(cherry picked from commit f16ecaf4fc414d951fe9b1699d96e7eba3eab13a)

Review-Url: https://codereview.chromium.org/2560383002 .
Cr-Commit-Position: refs/branch-heads/2924@{#446}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-auto-mock-expected.html
[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-auto-mock.html
[add] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-orphaned-word-expected.html
[add] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/LayoutTests/fast/text/hyphens/hyphens-orphaned-word.html
[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/Source/core/layout/api/LineLayoutText.h
[modify] https://crrev.com/f0960024d3e442a84d4a1d38a136553013635463/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h

Comment 13 by kojii@chromium.org, Dec 10 2016

#7/#8: a simple test for orphaned words, works both in Canary and Safari:
http://jsbin.com/dunigu/edit?html,output

Comment 14 by kojii@chromium.org, Dec 12 2016

Labels: Merge-Request-55
As per the process. I think the fix is unlikely to cause other regressions.

Comment 15 by dimu@chromium.org, Dec 12 2016

Labels: -Merge-Request-55 Merge-Review-55 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M55), manual review required.
Labels: TE-Verified-56.0.2924.28 TE-Verified-M56
Verified the fix on Mac 10.12.1 using Chrome Beta #56.0.2924.28 as per the comment #0.

Observed that the attached html file displayed as expected as below:
   hyphen-
   ationalgo-
   rithm      

Hence, the fix is working as expected.

Attaching the screencast for reference

Adding the verified labels.
671125.mp4
584 KB View Download
Labels: -Merge-Review-55 Merge-Rejected-55
The fix is larger than we'd like to see, this is a Pri-2 and M55 is already deployed to stable across all platforms, so we should wait for M56 on this.  Rejecting merge, ping me if you have concerns.

Sign in to add a comment