Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r220717 - The none smooth stroke applied to an SVG shape breaks…
… its hit testing https://bugs.webkit.org/show_bug.cgi?id=175506 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-08-14 Reviewed by Simon Fraser. Source/WebCore: Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement(). The m_path will be recalculated when RenderSVGShape::updateShapeFromElement() is called from RenderSVGRect::shapeDependentStrokeContains(). Test: svg/stroke/stroke-linejoin-click.html * rendering/svg/RenderSVGRect.cpp: (WebCore::RenderSVGRect::updateShapeFromElement): * rendering/svg/RenderSVGShape.h: (WebCore::RenderSVGShape::clearPath): LayoutTests: * svg/stroke/stroke-linejoin-click-expected.html: Added. * svg/stroke/stroke-linejoin-click.html: Added.
- Loading branch information
1 parent
fe8fd35
commit fb91505
Showing
6 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
LayoutTests/svg/stroke/stroke-linejoin-click-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<style> | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
rect { | ||
fill: none; | ||
stroke-width: 6; | ||
stroke-linejoin: round; | ||
stroke: green; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<body> | ||
<svg> | ||
<rect x="30" y="30"/> | ||
</svg> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<style> | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
rect { | ||
fill: none; | ||
stroke-width: 6; | ||
stroke-linejoin: round; | ||
stroke: green; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<body> | ||
<svg> | ||
<rect x="10" y="10"/> | ||
</svg> | ||
<script> | ||
function moveRect(rect) { | ||
var x = parseFloat(rect.getAttribute("x")); | ||
var y = parseFloat(rect.getAttribute("y")); | ||
rect.setAttribute('x', x + 10); | ||
rect.setAttribute('y', y + 10); | ||
} | ||
|
||
(function() { | ||
var element = document.elementFromPoint(10, 10); | ||
if (element instanceof SVGRectElement) | ||
moveRect(element); | ||
|
||
element = document.elementFromPoint(20, 20); | ||
if (element instanceof SVGRectElement) | ||
moveRect(element); | ||
})(); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters