Simple line layout: Add support for -webkit-hyphenate-limit-lines
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 21:19:38 +0000 (21:19 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 21:19:38 +0000 (21:19 +0000)
commit5882d9acae11c57116980af30274ebfc205a8b05
tree749afad721a52e6c084390cb800dd89463db493b
parentb60737aac05c4f4387a4ecece7c05df25e56cbb1
Simple line layout: Add support for -webkit-hyphenate-limit-lines
https://bugs.webkit.org/show_bug.cgi?id=167446
<rdar://problem/30194030>

Reviewed by Antti Koivisto.

Source/WebCore:

Now we can set the limit on the number of lines that a word can split across through hyphenation.

Tests: fast/text/simple-line-layout-hyphen-limit-lines.html
       fast/text/simple-line-layout-hyphen-limit-lines2.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): The right side of the split has +1 on the wrapping counter.

LayoutTests:

* fast/text/simple-line-layout-hyphen-limit-lines-expected.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines2-expected.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines2.html: Added.
* platform/mac/fast/text/hyphenate-limit-lines-expected.txt: progression

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2.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.cpp
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h