Title: [171569] branches/safari-600.1-branch

Diff

Modified: branches/safari-600.1-branch/LayoutTests/ChangeLog (171568 => 171569)


--- branches/safari-600.1-branch/LayoutTests/ChangeLog	2014-07-25 01:05:25 UTC (rev 171568)
+++ branches/safari-600.1-branch/LayoutTests/ChangeLog	2014-07-25 01:08:28 UTC (rev 171569)
@@ -1,3 +1,21 @@
+2014-07-24  Lucas Forschler  <[email protected]>
+
+        Merge r171561
+
+    2014-07-24  Myles C. Maxfield  <[email protected]>
+
+            Crash when measuring a glyphs from a fallback SVG font
+            https://bugs.webkit.org/show_bug.cgi?id=135264
+
+            Reviewed by Simon Fraser.
+
+            Render some text with a fallback SVG Font including a glyph which
+            only exists in that fallback font. Make sure there is no crash.
+
+            * svg/text/resources/Litherum.svg:
+            * svg/text/svg-fallback-font-crash-expected.txt: Added.
+            * svg/text/svg-fallback-font-crash.html: Added.
+
 2014-07-23  Lucas Forschler  <[email protected]>
 
         Merge r171347

Modified: branches/safari-600.1-branch/LayoutTests/svg/text/resources/Litherum.svg (171568 => 171569)


--- branches/safari-600.1-branch/LayoutTests/svg/text/resources/Litherum.svg	2014-07-25 01:05:25 UTC (rev 171568)
+++ branches/safari-600.1-branch/LayoutTests/svg/text/resources/Litherum.svg	2014-07-25 01:08:28 UTC (rev 171569)
@@ -6,6 +6,7 @@
 <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"/>
+<glyph unicode="&#x20001;" horiz-adv-x="14" d="M5 -7v21h4v-21z"/>
 </font>
 </defs>
 </svg>

Copied: branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash-expected.txt (from rev 171561, trunk/LayoutTests/svg/text/svg-fallback-font-crash-expected.txt) (0 => 171569)


--- branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash-expected.txt	                        (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash-expected.txt	2014-07-25 01:08:28 UTC (rev 171569)
@@ -0,0 +1,2 @@
+This test makes sure that there is no crash if a character is rendered with a SVG fallback font. The test is successful if there is no crash.
+This is a foreign character. 𠀁 That was a foreign character.

Copied: branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash.html (from rev 171561, trunk/LayoutTests/svg/text/svg-fallback-font-crash.html) (0 => 171569)


--- branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash.html	                        (rev 0)
+++ branches/safari-600.1-branch/LayoutTests/svg/text/svg-fallback-font-crash.html	2014-07-25 01:08:28 UTC (rev 171569)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: 'Litherum';
+    src: url("./resources/Litherum.svg") format(svg)
+}
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+This test makes sure that there is no crash if a character is rendered with a SVG fallback font. The test is successful if there is no crash.
+<div style="font-family: 'Helvetica' 'Litherum';">This is a foreign character. &#x20001; That was a foreign character.</div>
+</body>
+</html>

Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (171568 => 171569)


--- branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-07-25 01:05:25 UTC (rev 171568)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-07-25 01:08:28 UTC (rev 171569)
@@ -1,5 +1,27 @@
 2014-07-24  Lucas Forschler  <[email protected]>
 
+        Merge r171561
+
+    2014-07-24  Myles C. Maxfield  <[email protected]>
+
+            Crash when measuring a glyphs from a fallback SVG font
+            https://bugs.webkit.org/show_bug.cgi?id=135264
+
+            Reviewed by Simon Fraser.
+
+            We can't realize font data for all fallback fonts ahead
+            of time, but we don't have all the necessary context to
+            realize SVG fallback data when it's needed. For now, we
+            can just bail; however, a larger, more invasive fix is
+            in order.
+
+            Test: svg/text/svg-fallback-font-crash.html
+
+            * platform/graphics/WidthIterator.cpp:
+            (WebCore::applyFontTransforms):
+
+2014-07-24  Lucas Forschler  <[email protected]>
+
         Merge r171559
 
     2014-07-24  Daniel Bates  <[email protected]>

Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/WidthIterator.cpp (171568 => 171569)


--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/WidthIterator.cpp	2014-07-25 01:05:25 UTC (rev 171568)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/WidthIterator.cpp	2014-07-25 01:08:28 UTC (rev 171569)
@@ -123,10 +123,12 @@
 #else
     // We need to handle transforms on SVG fonts internally, since they are rendered internally.
     if (fontData->isSVGFont()) {
-        ASSERT(iterator.run().renderingContext());
         // SVG font ligatures are handled during glyph selection, only kerning remaining.
-        if (typesettingFeatures & Kerning)
+        if (iterator.run().renderingContext() && (typesettingFeatures & Kerning)) {
+            // FIXME: We could pass the necessary context down to this level so we can lazily create rendering contexts at this point.
+            // However, a larger refactoring of SVG fonts might necessary to sidestep this problem completely.
             iterator.run().renderingContext()->applySVGKerning(fontData, iterator, glyphBuffer, lastGlyphCount);
+        }
     } else
 #endif
         fontData->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, typesettingFeatures);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to