Simple line layout: Extend webkit-hyphenate-limit-lines to cover subsequent words.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Mar 2017 22:14:30 +0000 (22:14 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Mar 2017 22:14:30 +0000 (22:14 +0000)
commitf9375ab869179d856c594ca4f8dfab2eeb6beecc
treeacbf4adfff870a5fac7324793a75f119b65ba040
parentbeb0a95bb0a43d1067b50c654ee5c8ffd8096387
Simple line layout: Extend webkit-hyphenate-limit-lines to cover subsequent words.
https://bugs.webkit.org/show_bug.cgi?id=169631

Reviewed by Antti Koivisto.

Source/WebCore:

This patch extends webkit-hyphenate-limit-lines to cover separate words across multiple lines.
Example:
  webkit-hyphenate-limit-lines: 1;
  "if this line wraps at foo-
  bar, the next line should
  not hyphenate at all. How-
  ever the line after that
  could."

Test: fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::setHyphenationDisabled):
(WebCore::SimpleLineLayout::LineState::isHyphenationDisabled):
(WebCore::SimpleLineLayout::updateLineConstrains):
(WebCore::SimpleLineLayout::hyphenPositionForFragment):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::createTextRuns):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter): Deleted.

LayoutTests:

* fast/text/simple-line-layout-hyphenation-limit-lines-accross-words-expected.html: Added.
* fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/simple-line-layout-hyphenation-limit-lines-accross-words-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h