| Index: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
|
| index 0a91c0cddf3f7cc5a6336bfeef8534b4656d6acc..c5d87328b6ec5d431b1d6980f9102d62a27138b6 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
|
| @@ -125,9 +125,14 @@ void SVGTextLayoutEngine::computeCurrentFragmentMetrics(
|
| const Font& scaledFont = textLineLayout.scaledFont();
|
| FloatRect glyphOverflowBounds;
|
|
|
| + const SimpleFontData* fontData = scaledFont.primaryFont();
|
| + DCHECK(fontData);
|
| + if (!fontData)
|
| + return;
|
| +
|
| float width = scaledFont.width(run, nullptr, &glyphOverflowBounds);
|
| - float ascent = scaledFont.getFontMetrics().floatAscent();
|
| - float descent = scaledFont.getFontMetrics().floatDescent();
|
| + float ascent = fontData->getFontMetrics().floatAscent();
|
| + float descent = fontData->getFontMetrics().floatDescent();
|
| m_currentTextFragment.glyphOverflow.setFromBounds(glyphOverflowBounds, ascent,
|
| descent, width);
|
| m_currentTextFragment.glyphOverflow.top /= scalingFactor;
|
| @@ -135,7 +140,7 @@ void SVGTextLayoutEngine::computeCurrentFragmentMetrics(
|
| m_currentTextFragment.glyphOverflow.right /= scalingFactor;
|
| m_currentTextFragment.glyphOverflow.bottom /= scalingFactor;
|
|
|
| - float height = scaledFont.getFontMetrics().floatHeight();
|
| + float height = fontData->getFontMetrics().floatHeight();
|
| m_currentTextFragment.height = height / scalingFactor;
|
| m_currentTextFragment.width = width / scalingFactor;
|
| }
|
|
|