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.
Created attachment 276839 [details] Patch
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 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
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
Fixed in r199818.
rdar://problem/23786022
Added an ios-simulator baseline for the test added with this change in <https://trac.webkit.org/r200135>