Chromium Code Reviews| 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..2760eef6585f1a54c12e8fb6b28a52c3b2362865 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp |
| @@ -452,14 +452,20 @@ PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC |
| if (!rootBox) |
| return createPositionWithAffinity(0); |
| + FloatPoint absolutePoint(pointInContents); |
|
fs
2016/01/19 13:30:04
Maybe call this "clippedPointInContents" or someth
|
| + if (absolutePoint.x() < 0) |
|
fs
2016/01/19 13:30:04
This operation would be the same as LayoutPoint::c
|
| + absolutePoint.setX(0); |
| + if (absolutePoint.y() < 0) |
| + absolutePoint.setY(0); |
| + |
| ASSERT(!rootBox->nextRootBox()); |
| ASSERT(childrenInline()); |
| - InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosition(pointInContents); |
| + InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosition(LayoutPoint(absolutePoint)); |
| if (!closestBox) |
| return createPositionWithAffinity(0); |
| - return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(pointInContents.x(), closestBox->y())); |
| + return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(absolutePoint.x(), closestBox->y())); |
| } |
| void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const |