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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220717
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-14 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ The none smooth stroke applied to an SVG shape breaks its hit testing
+ https://bugs.webkit.org/show_bug.cgi?id=175506
+
+ Reviewed by Simon Fraser.
+
+ * svg/stroke/stroke-linejoin-click-expected.html: Added.
+ * svg/stroke/stroke-linejoin-click.html: Added.
+
2017-08-14 Daniel Bates <dabates@apple.com>
[css-ui] Implement caret-color support
--- /dev/null
+<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>
--- /dev/null
+<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>
+2017-08-14 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ The none smooth stroke applied to an SVG shape breaks its hit testing
+ https://bugs.webkit.org/show_bug.cgi?id=175506
+
+ Reviewed by Simon Fraser.
+
+ 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):
+
2017-08-14 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Implement WebCore::standardUserAgent()
m_fillBoundingBox = FloatRect();
m_innerStrokeRect = FloatRect();
m_outerStrokeRect = FloatRect();
+ clearPath();
SVGLengthContext lengthContext(&rectElement());
FloatSize boundingBoxSize(lengthContext.valueForLength(style().width(), LengthModeWidth), lengthContext.valueForLength(style().height(), LengthModeHeight));
ASSERT(m_path);
return *m_path;
}
+ void clearPath() { m_path = nullptr; }
protected:
void element() const = delete;