Bug 156803

Summary: Don't hyphenate the last word in a paragraph.
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, jonlee, kondapallykalyan, mmaxfield, ryanhaddad, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+, buildbot: commit-queue-
Archive of layout-test-results from ews126 for ios-simulator-wk2 none

Description Dave Hyatt 2016-04-20 11:58:50 PDT
Don't hyphenate the last word in a paragraph if a fragment of the word would end up by itself on the last line. We make an exception if the line is empty though.
Comment 1 Dave Hyatt 2016-04-20 12:01:07 PDT
Created attachment 276839 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-04-20 12:10:22 PDT
Comment on attachment 276839 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276839&action=review

> Source/WebCore/rendering/line/BreakingContext.h:752
> -
> +    

Whitespace.

> Source/WebCore/rendering/line/BreakingContext.h:907
> +            

Whitespace.

> Source/WebCore/rendering/line/BreakingContext.h:943
> +                    // We don't try to hyphenate if we're looking at the final break of a block, since this means there is
> +                    // no more content, and we'd end up putting a hyphenated single word on a line by itself. This looks
> +                    // bad so we just don't allow it.

Lots of "we" here. Would read better as "Don't try to hyphenate if...".

> Source/WebCore/rendering/line/BreakingContext.h:1131
> +        // We don't try to hyphenate if we're looking at the final break of a block, since this means there is
> +        // no more content, and we'd end up putting a hyphenated single word on a line by itself. This looks
> +        // bad so we just don't allow it.

More "We".
Comment 3 Build Bot 2016-04-20 12:54:17 PDT
Comment on attachment 276839 [details]
Patch

Attachment 276839 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1192177

New failing tests:
fast/text/hyphenate-avoid-orphaned-word.html
Comment 4 Build Bot 2016-04-20 12:54:20 PDT
Created attachment 276845 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 5 Dave Hyatt 2016-04-21 09:25:01 PDT
Fixed in r199818.
Comment 6 Jon Lee 2016-04-21 11:09:09 PDT
rdar://problem/23786022
Comment 7 Ryan Haddad 2016-04-27 11:22:25 PDT
Added an ios-simulator baseline for the test added with this change in <https://trac.webkit.org/r200135>