Index: third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp b/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp |
index 66d287986f29ced709aa9921a2c9eb06808c8df6..f34eda8e6eb757566239ab3fa173abec6d7bb76a 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp |
@@ -264,12 +264,24 @@ bool SVGInlineTextBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& |
LayoutPoint boxOrigin(x(), y()); |
boxOrigin.moveBy(accumulatedOffset); |
LayoutRect rect(boxOrigin, size()); |
- // FIXME: both calls to rawValue() below is temporary and should be removed once the transition |
- // to LayoutUnit-based types is complete (crbug.com/321237) |
if (locationInContainer.intersects(rect)) { |
- lineLayoutItem().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset)); |
- if (!result.addNodeToListBasedTestResult(lineLayoutItem().node(), locationInContainer, rect)) |
- return true; |
+ LineLayoutSVGInlineText lineLayoutItem = LineLayoutSVGInlineText(this->lineLayoutItem()); |
+ ASSERT(lineLayoutItem.scalingFactor()); |
+ float baseline = lineLayoutItem.scaledFont().fontMetrics().floatAscent() / lineLayoutItem.scalingFactor(); |
+ |
+ AffineTransform fragmentTransform; |
+ for (const auto& fragment : m_textFragments) { |
+ FloatRect fragmentRect(fragment.x, fragment.y - baseline, fragment.width, fragment.height); |
fs
2015/11/17 09:47:49
You did not make this a (Float)Quad as in the orig
pdr.
2015/11/17 21:51:23
Good catch. This was a mistake.
I was planning on
|
+ fragment.buildFragmentTransform(fragmentTransform); |
+ if (!fragmentTransform.isIdentity()) |
+ fragmentRect = fragmentTransform.mapRect(fragmentRect); |
+ |
+ if (fragmentRect.contains(FloatPoint(locationInContainer.point()))) { |
+ lineLayoutItem.updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset)); |
+ if (!result.addNodeToListBasedTestResult(lineLayoutItem.node(), locationInContainer, rect)) |
+ return true; |
+ } |
+ } |
} |
} |
} |