[iOS] Regression(r176202): line-height is wrong on marco.org
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Nov 2014 01:22:41 +0000 (01:22 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Nov 2014 01:22:41 +0000 (01:22 +0000)
commit62e7de6fee708c2f764790f67d2d04690e594306
tree1ca9421d675edd8f4c2da62d87aa0e88cec719f9
parentead36aee53de79a4cd2218dd6b72d1f81afe6e7b
[iOS] Regression(r176202): line-height is wrong on marco.org
https://bugs.webkit.org/show_bug.cgi?id=138970

Reviewed by Simon Fraser.

Source/WebCore:

After r176202, on iOS with IOS_TEXT_AUTOSIZING enabled, we would
multiply the lineHeight by RenderStyle::textSizeAdjust()::multiplier()
unconditionally. However, we're only supposed to do so if
RenderStyle::textSizeAdjust()::isPercentage() returns true. This
patch reintroduces the textSizeAdjust().isPercentage() check that was
inadvertently dropped when refactoring the code to be shared between
iOS and OS X.

Additionally, the multiplier is only supposed the be applied if the
input CSSPrimitiveValue is a Length or a Number. However, after
r176202, we would apply the multiplier if the CSSPrimitiveValue is
a Percentage or a Number. This patch updates the code to match the
behavior prior to r176202.

Test: fast/css/line-height-text-autosizing.html

* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::convertLineHeight):
(WebCore::StyleBuilderFunctions::applyValueLineHeight):

LayoutTests:

Add layout test to cover line-height CSS property and its interaction
with -webkit-text-size-adjust.

* fast/css/line-height-text-autosizing-expected.txt: Added.
* fast/css/line-height-text-autosizing.html: Added.
* platform/ios-simulator/fast/css/line-height-text-autosizing-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/line-height-text-autosizing-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/line-height-text-autosizing.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/ios-simulator/fast/css/line-height-text-autosizing-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleBuilderCustom.h