WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-119747-20140303193412.patch (text/plain), 6.67 KB, created by
Myles C. Maxfield
on 2014-03-03 19:34:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2014-03-03 19:34:12 PST
Size:
6.67 KB
patch
obsolete
>Subversion Revision: 165031 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 415f8fe684eb1f2575089e0f01f42171e0725da2..5a622c0acdc71e79d7f16b8987ae83ea02faa1a3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,23 @@ > 2014-03-03 Myles C. Maxfield <mmaxfield@apple.com> > >+ 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 NOBODY (OOPS!). >+ >+ 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. >+ >+ Test: svg/text/svg-font-hittest.html >+ >+ * platform/graphics/Font.cpp: >+ (WebCore::Font::offsetForPosition): >+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: >+ (WebCore::FontPlatformData::ctFont): >+ >+2014-03-03 Myles C. Maxfield <mmaxfield@apple.com> >+ > GraphicsContext::drawLineForText needs to be exported from WebCore.dylib for iOS builds > https://bugs.webkit.org/show_bug.cgi?id=129647 > >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index f576df080222283f31c37cfc633430042cf64483..3805c7c7947faea527e24f822584c3eecddb5ded 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -444,7 +444,7 @@ FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point > int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const > { > // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050 >- if (codePath(run) != Complex && !typesettingFeatures()) >+ if (codePath(run) != Complex && (!typesettingFeatures() || run.renderingContext())) > return offsetForPositionForSimpleText(run, x, includePartialGlyphs); > > return offsetForPositionForComplexText(run, x, includePartialGlyphs); >diff --git a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >index e8d84b1ee16e4fa7e7a73812b5677116e2f69fd7..2e7fdd9e861189b68bb19601113c1b0077c4e336 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >@@ -308,6 +308,7 @@ CTFontRef FontPlatformData::ctFont() const > if (m_CTFont) > return m_CTFont.get(); > >+ ASSERT(m_cgFont.get()); > #if !PLATFORM(IOS) > m_CTFont = toCTFontRef(m_font); > if (m_CTFont) { >@@ -319,10 +320,8 @@ CTFontRef FontPlatformData::ctFont() const > else > fontDescriptor = cascadeToLastResortFontDescriptor(); > m_CTFont = adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor)); >- } else { >- ASSERT(m_cgFont.get()); >+ } else > m_CTFont = adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor())); >- } > #else > // Apple Color Emoji size is adjusted (and then re-adjusted by Core Text) and capped. > CGFloat size = !m_isEmoji ? m_size : m_size <= 15 ? 4 * (m_size + 2) / static_cast<CGFloat>(5) : 16; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index bac652183355bc9bbe4a2fd02b7ffb85400b8018..89c4500da00d592802cdc6636e9f165ced75c73f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,5 +1,20 @@ > 2014-03-03 Myles C. Maxfield <mmaxfield@apple.com> > >+ 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 NOBODY (OOPS!). >+ >+ 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. >+ >+ * svg/text/resources/Litherum.svg: Added. >+ * svg/text/svg-font-hittest-expected.txt: Added. >+ * svg/text/svg-font-hittest.html: Added. >+ >+2014-03-03 Myles C. Maxfield <mmaxfield@apple.com> >+ > Space between double underlines does not scale with font size > https://bugs.webkit.org/show_bug.cgi?id=129521 > >diff --git a/LayoutTests/svg/text/resources/Litherum.svg b/LayoutTests/svg/text/resources/Litherum.svg >new file mode 100644 >index 0000000000000000000000000000000000000000..042c7ed94ef174be60b960738644c90d310970fa >--- /dev/null >+++ b/LayoutTests/svg/text/resources/Litherum.svg >@@ -0,0 +1,11 @@ >+<?xml version="1.0" standalone="no"?> >+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > >+<svg xmlns="http://www.w3.org/2000/svg"> >+<metadata></metadata> >+<defs> >+<font id="Litherum" horiz-adv-x="1024"> >+<font-face units-per-em="14" ascent="14" descent="-7"/> >+<glyph unicode="|" horiz-adv-x="14" d="M5 -7v21h4v-21z"/> >+</font> >+</defs> >+</svg> >diff --git a/LayoutTests/svg/text/svg-font-hittest-expected.txt b/LayoutTests/svg/text/svg-font-hittest-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c235c1ec2903245bef82329d8dd1d6e856be587f >--- /dev/null >+++ b/LayoutTests/svg/text/svg-font-hittest-expected.txt >@@ -0,0 +1,3 @@ >+This code triggers the glyph hit-testing code, which should not crash when a glyph is drawn with SVG fonts. >+Pass >+| >diff --git a/LayoutTests/svg/text/svg-font-hittest.html b/LayoutTests/svg/text/svg-font-hittest.html >new file mode 100644 >index 0000000000000000000000000000000000000000..21266509d82c937941271ed1d22c176c4e593e84 >--- /dev/null >+++ b/LayoutTests/svg/text/svg-font-hittest.html >@@ -0,0 +1,36 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+@font-face { >+ font-family: 'Litherum'; >+ src: url("./resources/Litherum.svg") format(svg) >+} >+#p { >+ font: 1000px 'Litherum'; >+} >+</style> >+</head> >+<body> >+This code triggers the glyph hit-testing code, which should not >+crash when a glyph is drawn with SVG fonts. >+<div id="result"></div> >+<div id="p">|</div> >+<script> >+ // There doesn't seem to be an event that fires after SVG fonts >+ // are all downloaded and text is re-laid-out ... >+ window.setTimeout((function() { >+ if (document.caretRangeFromPoint(400, 300)) >+ document.getElementById("result").innerText = "Pass"; >+ else >+ document.getElementById("result").innerText = "Fail"; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }), 100); >+ if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ } >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 119747
:
225729
|
226344
|
228305