Use underlining metrics from the font file
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Nov 2014 18:04:13 +0000 (18:04 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Nov 2014 18:04:13 +0000 (18:04 +0000)
commit4ad842c65ef47a7efc0c78bbbd5089abb71d7040
tree3c1da2cbff2241c24dbcaeaa38c20c6db702febb
parentebf256ef0608521a3ce6fab329993d96a1d24e2c
Use underlining metrics from the font file
https://bugs.webkit.org/show_bug.cgi?id=138762

Patch by Myles C. Maxfield <litherum@gmail.com> on 2014-11-18
Reviewed by Dave Hyatt.

Source/WebCore:

Test: platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness.html

* platform/graphics/FontMetrics.h: Adding variables for text decoration thickness and
underline position.
(WebCore::FontMetrics::FontMetrics):
(WebCore::FontMetrics::decorationThickness):
(WebCore::FontMetrics::setDecorationThickness):
(WebCore::FontMetrics::underlinePosition):
(WebCore::FontMetrics::setUnderlinePosition):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::platformInit): Initialize new FontMetrics members.
* platform/graphics/ios/SimpleFontDataIOS.mm:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::SimpleFontData::initGDIFont): Ditto.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration): Use FontMetrics data.
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset): Ditto.
(WebCore::visualOverflowForDecorations): Ditto.
* style/InlineTextBoxStyle.h:
(WebCore::textDecorationStrokeThickness): Deleted.
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::initializeFontData): Initialize new FontMetrics members.

LayoutTests:

This patch makes underline placement platform-dependent.

* platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html: Renamed from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html.
* platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness.html: Renamed from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html [moved from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html with 100% similarity]
LayoutTests/platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness.html [moved from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html with 86% similarity]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontMetrics.h
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm
Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp
Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/style/InlineTextBoxStyle.cpp
Source/WebCore/style/InlineTextBoxStyle.h
Source/WebCore/svg/SVGFontData.cpp