REGRESSION (r176751): line-height ignored in <button> elements
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Apr 2015 21:25:02 +0000 (21:25 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Apr 2015 21:25:02 +0000 (21:25 +0000)
commit4b6417a7c50b0020bfc87145578274a11847904e
treea8b17b2daed500012f099fb59a7a69b1c3f516a2
parentb3274485565dd7ce776bc4ac4b22be057bf2bf8a
REGRESSION (r176751): line-height ignored in <button> elements
https://bugs.webkit.org/show_bug.cgi?id=144234

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/forms/button-line-height.html

* platform/Theme.h: Changed controlFont to return an Optional so we can tell
when the theme is overriding the font. Otherwise if the font from the user-agent
style sheet and the font from the theme are the same, we will think we are not
overriding the font when we actually are.

* platform/mac/ThemeMac.h: Updated controlFont to return Optional.
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::controlFont): Ditto.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle): Set line height only if the font is
overriden by the theme, all the time for PushButtonPart on Mac, and not at all
for other parts. Also tightened up the logic a little since RenderStyle's
setFontDescription already does an "==" comparison; we don't have to do
that twice.

LayoutTests:

* fast/forms/button-line-height-expected.html: Added.
* fast/forms/button-line-height.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/button-line-height-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/button-line-height.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/Theme.h
Source/WebCore/platform/mac/ThemeMac.h
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/rendering/RenderTheme.cpp