<rdar://problem/9093327> Implement -hyphenate-limit-{before,after}
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Mar 2011 22:44:48 +0000 (22:44 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Mar 2011 22:44:48 +0000 (22:44 +0000)
commit11d8c08bd225c3b59062e77a3edbe176460f7987
treeb6adef851e09764606551fae8035522c470932fe
parent1695d8840ed4bc2fe64535f53c5dfc6be48eaf55
<rdar://problem/9093327> Implement -hyphenate-limit-{before,after}
https://bugs.webkit.org/show_bug.cgi?id=55850

Reviewed by Oliver Hunt.

Source/WebCore:

Tests: fast/css/parsing-hyphenate-limit.html
       fast/text/hyphenate-limit-before-after.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedProperties) Updated this array with the new properties and some old properties
that it was missing.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added
CSSPropertyWebkitHyphenateLimit{Before,After}.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Parse -webkit-hyphenate-limit-{before,after}, allowing
'auto' and non-negative integers.

* css/CSSPropertyNames.in: Added -webkit-hyphenate-limit-{before,after}.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty): Handle CSSPropertyWebkitHyphenateLimit{Before,After}.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::tryHyphenating): Added minimum prefix and suffix length parameters and checks to only
allow hyphenation if the prefix and the suffix are sufficiently long.
(WebCore::RenderBlock::findNextLineBreak): Pass the limits to tryHyphenating().

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff): A difference in hyphenation limits is a layout difference.

* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::hyphenationLimitBefore): Added.
(WebCore::InheritedFlags::hyphenationLimitAfter): Added.
(WebCore::InheritedFlags::setHyphenationLimitBefore): Added.
(WebCore::InheritedFlags::setHyphenationLimitAfter): Added.
(WebCore::InheritedFlags::initialHyphenationLimitBefore): Added. Returns -1, which is the
representation of 'auto'.
(WebCore::InheritedFlags::initialHyphenationLimitAfter): Ditto.

* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Initialize hyphenation limits.
(WebCore::StyleRareInheritedData::operator==): Compare hyphenation limits.
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/parsing-hyphenate-limit-expected.txt: Added.
* fast/css/parsing-hyphenate-limit.html: Added.
* fast/text/hyphenate-limit-before-after.html: Added.
* platform/mac/fast/text/hyphenate-limit-before-after-expected.checksum: Added.
* platform/mac/fast/text/hyphenate-limit-before-after-expected.png: Added.
* platform/mac/fast/text/hyphenate-limit-before-after-expected.txt: Added.
* svg/css/getComputedStyle-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/parsing-hyphenate-limit-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/parsing-hyphenate-limit.html [new file with mode: 0644]
LayoutTests/fast/text/hyphenate-limit-before-after.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-before-after-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-before-after-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/hyphenate-limit-before-after-expected.txt [new file with mode: 0644]
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
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/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h