Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
index cc7ad13610ec10a955b4fe2a5674a63bbfdba025..1a1331394b907fb0a7e9ae0776e36dc621f1844c 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
@@ -452,14 +452,17 @@ PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC |
if (!rootBox) |
return createPositionWithAffinity(0); |
+ LayoutPoint clippedPointInContents(pointInContents); |
+ clippedPointInContents.clampNegativeToZero(); |
+ |
ASSERT(!rootBox->nextRootBox()); |
ASSERT(childrenInline()); |
- InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosition(pointInContents); |
+ InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosition(clippedPointInContents); |
if (!closestBox) |
return createPositionWithAffinity(0); |
- return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(pointInContents.x(), closestBox->y())); |
+ return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(clippedPointInContents.x(), closestBox->y())); |
} |
void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const |