Bug 37325 - SVG Padding stops mouse events
Summary: SVG Padding stops mouse events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-09 03:33 PDT by Peter Josling
Modified: 2011-11-15 07:38 PST (History)
3 users (show)

See Also:


Attachments
A simple SVG image with a rectangle - alert box appears on click. Works as expected (303 bytes, image/svg+xml)
2010-06-01 09:58 PDT, Peter Josling
no flags Details
Same image as before - but style="padding:100px;" added to the SVG element. Rectangle no longer responds to click. (327 bytes, image/svg+xml)
2010-06-01 09:59 PDT, Peter Josling
no flags Details
Fix SVG hit testing when padding is present and add associated test (3.52 KB, patch)
2011-11-14 19:13 PST, Philip Rogers
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.