Bug 37325

Summary: SVG Padding stops mouse events
Product: WebKit Reporter: Peter Josling <peterjosling>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: krit, pdr, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
A simple SVG image with a rectangle - alert box appears on click. Works as expected
none
Same image as before - but style="padding:100px;" added to the SVG element. Rectangle no longer responds to click.
none
Fix SVG hit testing when padding is present and add associated test none

Description Peter Josling 2010-04-09 03:33:20 PDT
Creating an SVG image with padding (ie <svg style = "padding:10px" etc.) causes onclick/onmousedown/onmouseover etc events to stop working. The image still displays properly, but mouse events do not register.
Comment 1 Dirk Schulze 2010-05-09 23:19:57 PDT
Peter, can you add a simple test case to this bug please?
Comment 2 Peter Josling 2010-06-01 09:58:21 PDT
Created attachment 57555 [details]
A simple SVG image with a rectangle - alert box appears on click. Works as expected
Comment 3 Peter Josling 2010-06-01 09:59:15 PDT
Created attachment 57556 [details]
Same image as before - but style="padding:100px;" added to the SVG element. Rectangle no longer responds to click.
Comment 4 Peter Josling 2010-06-01 09:59:40 PDT
Added test case
Comment 5 Philip Rogers 2011-11-14 19:13:36 PST
Created attachment 115086 [details]
Fix SVG hit testing when padding is present and add associated test
Comment 6 Nikolas Zimmermann 2011-11-15 06:20:13 PST
Comment on attachment 115086 [details]
Fix SVG hit testing when padding is present and add associated test

View in context: https://bugs.webkit.org/attachment.cgi?id=115086&action=review

Looks great to me, please update the comment and land manually, or reuploaded it and I'll set the flags again.

> Source/WebCore/rendering/svg/RenderSVGRoot.cpp:431
>      // Note: For now, we're ignoring hits to border and padding for <svg>

This comment is invalid now, no?
Comment 7 Philip Rogers 2011-11-15 06:23:39 PST
(In reply to comment #6)
> (From update of attachment 115086 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115086&action=review
> 
> Looks great to me, please update the comment and land manually, or reuploaded it and I'll set the flags again.
> 
> > Source/WebCore/rendering/svg/RenderSVGRoot.cpp:431
> >      // Note: For now, we're ignoring hits to border and padding for <svg>
> 
> This comment is invalid now, no?

I think it's still valid, it was just implemented wrong. We still do ignore mouse movements on the padding and borders of a SVG element, but now the positioning is correct so we don't account for the padding twice.
Comment 8 Nikolas Zimmermann 2011-11-15 06:29:25 PST
Comment on attachment 115086 [details]
Fix SVG hit testing when padding is present and add associated test

Fair enough, cq+ then.
Comment 9 WebKit Review Bot 2011-11-15 07:38:24 PST
Comment on attachment 115086 [details]
Fix SVG hit testing when padding is present and add associated test

Clearing flags on attachment: 115086

Committed r100280: <http://trac.webkit.org/changeset/100280>
Comment 10 WebKit Review Bot 2011-11-15 07:38:28 PST
All reviewed patches have been landed.  Closing bug.