Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / svg / SVGTextMetrics.cpp
index 26dbc4c..a376aed 100644 (file)
@@ -22,7 +22,6 @@
 #include "core/rendering/svg/SVGTextMetrics.h"
 
 #include "core/rendering/svg/RenderSVGInlineText.h"
-#include "core/rendering/svg/SVGTextRunRenderingContext.h"
 
 namespace blink {
 
@@ -30,7 +29,6 @@ SVGTextMetrics::SVGTextMetrics()
     : m_width(0)
     , m_height(0)
     , m_length(0)
-    , m_glyph(0)
 {
 }
 
@@ -38,7 +36,6 @@ SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
     : m_width(0)
     , m_height(0)
     , m_length(1)
-    , m_glyph(0)
 {
 }
 
@@ -50,14 +47,13 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* textRenderer, const TextRun&
     ASSERT(scalingFactor);
 
     const Font& scaledFont = textRenderer->scaledFont();
-    int length = 0;
 
     // Calculate width/height using the scaled font, divide this result by the scalingFactor afterwards.
-    m_width = scaledFont.width(run, length, m_glyph) / scalingFactor;
+    m_width = scaledFont.width(run) / scalingFactor;
     m_height = scaledFont.fontMetrics().floatHeight() / scalingFactor;
 
-    ASSERT(length >= 0);
-    m_length = static_cast<unsigned>(length);
+    ASSERT(run.length() >= 0);
+    m_length = static_cast<unsigned>(run.length());
 }
 
 TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned position, unsigned length)
@@ -86,9 +82,6 @@ TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned pos
             run.setText(text->characters16() + position, length);
     }
 
-    if (textRunNeedsRenderingContext(style->font()))
-        run.setRenderingContext(SVGTextRunRenderingContext::create(text));
-
     // We handle letter & word spacing ourselves.
     run.disableSpacing();
 
@@ -110,17 +103,15 @@ SVGTextMetrics SVGTextMetrics::measureCharacterRange(RenderSVGInlineText* text,
     return SVGTextMetrics(text, constructTextRun(text, position, length));
 }
 
-SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width, Glyph glyphNameGlyphId)
+SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width)
 {
     ASSERT(text);
 
-    bool needsContext = textRunNeedsRenderingContext(text->style()->font());
     float scalingFactor = text->scalingFactor();
     ASSERT(scalingFactor);
 
     m_width = width / scalingFactor;
     m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor;
-    m_glyph = needsContext ? glyphNameGlyphId : 0;
 
     m_length = length;
 }