Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp |
| index 452d7234e434a72b169f17fbdad3f42e98af7acc..6b93388b791d60205060d5c0cee5f84a78b921cb 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp |
| @@ -99,6 +99,9 @@ void LayoutSVGBlock::styleDidChange(StyleDifference diff, |
| void LayoutSVGBlock::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, |
| TransformState& transformState, |
| MapCoordinatesFlags flags) const { |
| + // Convert from local HTML coordinates to local SVG coordinates. |
| + transformState.move(locationOffset()); |
| + // Apply other mappings on local SVG coordinates. |
| SVGLayoutSupport::mapLocalToAncestor(this, ancestor, transformState, flags); |
| } |
| @@ -108,12 +111,18 @@ void LayoutSVGBlock::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, |
| if (this == ancestor) |
| return; |
| + // Map to local SVG coordinates. |
| SVGLayoutSupport::mapAncestorToLocal(*this, ancestor, transformState, flags); |
| + // Convert from local SVG coordinates to local HTML coordinates. |
| + transformState.move(locationOffset()); |
|
Xianzhu
2017/03/28 17:45:09
This is the fix. In the original patch, this was "
|
| } |
| const LayoutObject* LayoutSVGBlock::pushMappingToContainer( |
| const LayoutBoxModelObject* ancestorToStopAt, |
| LayoutGeometryMap& geometryMap) const { |
| + // Convert from local HTML coordinates to local SVG coordinates. |
| + geometryMap.push(this, locationOffset()); |
| + // Apply other mappings on local SVG coordinates. |
| return SVGLayoutSupport::pushMappingToContainer(this, ancestorToStopAt, |
| geometryMap); |
| } |
| @@ -128,6 +137,9 @@ bool LayoutSVGBlock::mapToVisualRectInAncestorSpaceInternal( |
| VisualRectFlags) const { |
| transformState.flatten(); |
| LayoutRect rect(transformState.lastPlanarQuad().boundingBox()); |
| + // Convert from local HTML coordinates to local SVG coordinates. |
| + rect.moveBy(location()); |
| + // Apply other mappings on local SVG coordinates. |
| bool retval = SVGLayoutSupport::mapToVisualRectInAncestorSpace( |
| *this, ancestor, FloatRect(rect), rect); |
| transformState.setQuad(FloatQuad(FloatRect(rect))); |