line-height: <number> gets visually applied twice when text autosizing is in effect
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jul 2017 05:52:30 +0000 (05:52 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jul 2017 05:52:30 +0000 (05:52 +0000)
commit3149c180f6f9cf1aecafe6e1ca7b30aaf53f6e2d
tree1a51e22c2fc7ec2e50e8a6b783226682bf853c04
parentd95055c2837b175c9b6e7dd406447ef622d77d1e
line-height: <number> gets visually applied twice when text autosizing is in effect
https://bugs.webkit.org/show_bug.cgi?id=174536
<rdar://problem/33338259>

Reviewed by Simon Fraser.

Source/WebCore:

StyleBuilderConverter::convertLineHeight() converts line-height: <number> into a
"percentage" length. Then, when layout needs to know what the computed value of
line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
the computed font size.

With autosizing, the computed font size already incorporates the autosizing
multiplier, so we shouldn't also incorporate this multiplier into the percentage
value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
this double application by multiplying the percentage by the font-size's specified
value instead of its computed value, which is incorrect.

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

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::lineHeightFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineHeight):

LayoutTests:

* fast/text-autosizing/line-height-number-expected.html: Added.
* fast/text-autosizing/line-height-number.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text-autosizing/line-height-number-expected.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/line-height-number.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleBuilderConverter.h