<rdar://problem/8881922> Support the hyphenate-limit-lines property
https://bugs.webkit.org/show_bug.cgi?id=67730
Reviewed by Dave Hyatt.
Source/WebCore:
Tests: fast/css/parsing-hyphenate-limit-lines.html
fast/text/hyphenate-limit-lines.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added hyphenate-limit-lines.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Ditto. Valid values are non-negative integers and the keyword
"no-limit".
* css/CSSPropertyNames.in: Added -webkit-hyphenate-limit-lines.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty): Added hyphenate-limit-lines.
* css/CSSValueKeywords.in: Added the "no-limit" value keyword.
* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloats): Count the number of consecutive hyphenated lines
before the start line and pass it to layoutRunsAndFloatsInRange().
(WebCore::RenderBlock::layoutRunsAndFloatsInRange): Keep track of the number of consecutive
hyphenated lines before the current line and pass it to LineBreaker::nextLineBreak().
(WebCore::tryHyphenating): Added parameters for the number of consecutive hyphenated lines before
the current line and the limit on consecutive hyphenated lines, and an early return if the limit
has been reached.
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Added a parameter for the number of consecutive
hyphenated lines before the current line, which is passed through to tryHyphenating, along with
the value of hyphenate-limit-lines.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::isHyphenated): Added. Returns true if the line was hyphenated.
* rendering/RootInlineBox.h:
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::hyphenationLimitLines): Added this getter.
(WebCore::InheritedFlags::setHyphenationLimitLines): Added this setter.
(WebCore::InheritedFlags::initialHyphenationLimitLines): Added. The initial value is -1,
corresponding to "no-limit".
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Initialize new member variable.
(WebCore::StyleRareInheritedData::operator==): Compare new member variable.
* rendering/style/StyleRareInheritedData.h:
LayoutTests:
* fast/css/parsing-hyphenate-limit-lines-expected.txt: Added.
* fast/css/parsing-hyphenate-limit-lines.html: Added.
* fast/text/hyphenate-limit-lines.html: Added.
* platform/mac/fast/text/hyphenate-limit-lines-expected.png: Added.
* platform/mac/fast/text/hyphenate-limit-lines-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed