svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html and svg/css/font-face...
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 20:05:08 +0000 (20:05 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 20:05:08 +0000 (20:05 +0000)
commit93d62d6d9b910b43281dccdeecda7dbca2b4475b
treef5397636802be6c78d4e98a23586bac665a7a14f
parent884fdfde0e291af13121e7ddc31ea628720341ad
svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html and svg/css/font-face-crash.html frequently assert in ComplexTextController::offsetForPosition
https://bugs.webkit.org/show_bug.cgi?id=119747

Reviewed by Simon Fraser.

Source/WebCore:

Even though kerning and ligatures currently don't work with the
simple text path, messing those up is better than creating null
CTRun and CTLine objects.

Rather than calling the badly-named renderingContext() function on TextRun objects
to determine if they are drawn with an SVG font, this patch creates a wrapper function
with a better name and uses that instead.

Test: svg/text/svg-font-hittest.html

* platform/graphics/Font.cpp:
(WebCore::isDrawnWithSVGFont): Wrapper around renderingContext()
(WebCore::Font::drawText): Use wrapper function
(WebCore::Font::drawEmphasisMarks): Use wrapper function
(WebCore::Font::width): Use wrapper function
(WebCore::Font::selectionRectForText): Use wrapper function
(WebCore::Font::offsetForPosition): If we are using an SVG font, use the simple path
instead of the complex one
(WebCore::Font::codePath): Use wrapper function
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont):

LayoutTests:

Clicking on SVG text used to cause a ComplexTextController to be built
around the SVG text (which is incorrect and would crash). This test
does just that and makes sure there is no crash.

* svg/text/resources/Litherum.svg: Added.
* svg/text/svg-font-hittest-expected.txt: Added.
* svg/text/svg-font-hittest.html: Added.
* LayoutTests/platform/mac/TestExpectations: Unskipped tests

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/svg/text/resources/Litherum.svg [new file with mode: 0644]
LayoutTests/svg/text/svg-font-hittest-expected.txt [new file with mode: 0644]
LayoutTests/svg/text/svg-font-hittest.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm