Text with "text-overflow:ellipsis" and an SVG font do not render correctly
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jul 2013 20:07:42 +0000 (20:07 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jul 2013 20:07:42 +0000 (20:07 +0000)
commit08bd0518ef5caa1ffdad456bb1fa96e162166872
treee0f01d3559f0000be84a1096f6ceb01e331c953a
parent0c0433d1ccb90e2150b02aa2542e92fed44a1dbd
Text with "text-overflow:ellipsis" and an SVG font do not render correctly
https://bugs.webkit.org/show_bug.cgi?id=118669

Patch by Antoine Quint <graouts@apple.com> on 2013-07-15
Reviewed by David Kilzer.

Source/WebCore:

Partial runs may be routed through the complex path in several Font functions. While incomplete,
we can check for a non-NULL run.renderingContext() and exempt runs that have it from being forced
down the complex path. A more thorough fix is already tracked by http://webkit.org/b/100050.

Adding a new testcase which is a copy of svg/text/text-overflow-ellipsis-svgfont.html with kerning
and ligatures turned on explicitly since DRT runs with those off by default and this option is required
to be on for the issue to reproduce.

Fix courtesy of Dan Bernstein.

Test: svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html

* platform/graphics/Font.cpp:
(WebCore::Font::drawText):
(WebCore::Font::drawEmphasisMarks):
(WebCore::Font::selectionRectForText):

LayoutTests:

* platform/mac/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures-expected.png: Added.
* platform/mac/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures-expected.txt: Added.
* svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures-expected.txt [new file with mode: 0644]
LayoutTests/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp