[Webkit-unassigned] [Bug 175506] New: The none smooth stroke applied to an SVG shape breaks its hit testing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 11 18:27:26 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=175506

            Bug ID: 175506
           Summary: The none smooth stroke applied to an SVG shape breaks
                    its hit testing
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com
                CC: zimmermann at kde.org

Created attachment 317983

  --> https://bugs.webkit.org/attachment.cgi?id=317983&action=review

test case

Open the attached test case and try on click multiple times on the bottom right border of the two rectangles. The two rectangles are supposed to move 10px down and 10px down.

Result: The red rectangle seems to respond only on its original rectangle in spite of its movement. This can be seen if you hover its border after the first click. The cursor should change to the move shape but it does not. So the only way to move it to after the first click is to keep the mouse position still and do not move it. The green rectangle works as expected.

The reason is the red rectangle has the attribute stroke-linejoin="round". This makes the function RenderSVGRect::shapeDependentStrokeContains() falls back to the slow path through calling RenderSVGShape::shapeDependentStrokeContains() which uses m_path to check whether the stroke contains the point or not.

The bug is m_path gets only updated in RenderSVGRect::shapeDependentStrokeContains() when it is null. When RenderSVGRect::updateShapeFromElement() changes the renderer rectangles because of changing the 'x' and the 'y' attributes, the RenderSVGShape::m_path stays as is with the old rectangle. The fix is to make RenderSVGRect::updateShapeFromElement() clear RenderSVGShape::m_path so it is recalculated by RenderSVGRect::shapeDependentStrokeContains() when it is needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170812/1f50e658/attachment.html>


More information about the webkit-unassigned mailing list