<rdar://problem/8881922> Support the hyphenate-limit-lines property
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 20:59:39 +0000 (20:59 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 20:59:39 +0000 (20:59 +0000)
commitba7286c68e972fcda96f0190d5db79a091fa32cf
treea09e320a10db7a38da5e50f2e95e627eb007f43d
parenta1a00e1f17669a4a56838170d38193eef5c3c84b
<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: https://svn.webkit.org/repository/webkit/trunk@94710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/parsing-hyphenate-limit-lines-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/parsing-hyphenate-limit-lines.html [new file with mode: 0644]
LayoutTests/fast/text/hyphenate-limit-lines.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h