Title: [139387] branches/chromium/1364

Diff

Copied: branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair-expected.svg (from rev 138316, trunk/LayoutTests/svg/text/alt-glyph-for-surrogate-pair-expected.svg) (0 => 139387)


--- branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair-expected.svg	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair-expected.svg	2013-01-11 01:21:11 UTC (rev 139387)
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <svg width="200" height="100" xmlns="http://www.w3.org/2000/svg">
+    <font>
+      <font-face font-family="xyzzy" units-per-em="10"/>
+      <glyph id="sekrit" horiz-adv-x="14" d="m0,0 l10,0 l0,10 l-10,0 z"/>
+    </font>
+    <rect fill="green" x="25" y="9" width="16" height="16"/>
+    <text x="47" y="25" font-family="xyzzy">PASSED</text>
+  </svg>
+</html>
\ No newline at end of file

Copied: branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair.svg (from rev 138316, trunk/LayoutTests/svg/text/alt-glyph-for-surrogate-pair.svg) (0 => 139387)


--- branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair.svg	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/svg/text/alt-glyph-for-surrogate-pair.svg	2013-01-11 01:21:11 UTC (rev 139387)
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <svg width="200" height="100" xmlns="http://www.w3.org/2000/svg">
+    <font>
+      <font-face font-family="xyzzy" units-per-em="10"/>
+      <glyph id="sekrit" horiz-adv-x="14" d="m0,0 l10,0 l0,10 l-10,0 z"/>
+    </font>
+    <text x="25" y="25" font-family="xyzzy" stroke-width="10"><altGlyph fill="green" xlink:href=""
+  </svg>
+</html>
\ No newline at end of file

Modified: branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp (139386 => 139387)


--- branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp	2013-01-11 01:13:11 UTC (rev 139386)
+++ branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp	2013-01-11 01:21:11 UTC (rev 139387)
@@ -578,21 +578,10 @@
             y += m_dy;
         }
 
-        // Determine wheter we have to start a new fragment.
-        bool shouldStartNewFragment = false;
+        // Determine whether we have to start a new fragment.
+        bool shouldStartNewFragment = m_dx || m_dy || m_isVerticalText || m_inPathLayout || angle || angle != lastAngle
+            || orientationAngle || kerning || applySpacingToNextCharacter || definesTextLength;
 
-        if (m_dx || m_dy)
-            shouldStartNewFragment = true;
-
-        if (!shouldStartNewFragment && (m_isVerticalText || m_inPathLayout))
-            shouldStartNewFragment = true;
-
-        if (!shouldStartNewFragment && (angle || angle != lastAngle || orientationAngle))
-            shouldStartNewFragment = true;
-
-        if (!shouldStartNewFragment && (kerning || applySpacingToNextCharacter || definesTextLength))
-            shouldStartNewFragment = true;
-
         // If we already started a fragment, close it now.
         if (didStartTextFragment && shouldStartNewFragment) {
             applySpacingToNextCharacter = false;

Modified: branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (139386 => 139387)


--- branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp	2013-01-11 01:13:11 UTC (rev 139386)
+++ branches/chromium/1364/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp	2013-01-11 01:21:11 UTC (rev 139387)
@@ -65,9 +65,6 @@
         return;
     }
 
-    if (currentCharacterStartsSurrogatePair())
-        ASSERT(metricsLength == 2);
-
     float currentWidth = m_simpleWidthIterator->runWidthSoFar() - m_totalWidth;
     m_totalWidth = m_simpleWidthIterator->runWidthSoFar();
 

Modified: branches/chromium/1364/Source/WebCore/svg/SVGFontData.cpp (139386 => 139387)


--- branches/chromium/1364/Source/WebCore/svg/SVGFontData.cpp	2013-01-11 01:13:11 UTC (rev 139386)
+++ branches/chromium/1364/Source/WebCore/svg/SVGFontData.cpp	2013-01-11 01:21:11 UTC (rev 139387)
@@ -189,6 +189,16 @@
         size_t glyphsSize = glyphs.size();
         for (size_t i = 0; i < glyphsSize; ++i)
             glyphs[i].unicodeStringLength = run.length();
+
+        // Do not check alt glyphs for compatibility. Just return the first one.
+        // Later code will fail if we do not do this and the glyph is incompatible.
+        if (glyphsSize) {
+            SVGGlyph& svgGlyph = glyphs[0];
+            iterator.setLastGlyphName(svgGlyph.glyphName);
+            glyphData.glyph = svgGlyph.tableEntry;
+            advanceLength = svgGlyph.unicodeStringLength;
+            return true;
+        }
     } else
         associatedFontElement->collectGlyphsForString(remainingTextInRun, glyphs);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to