RESOLVED FIXED 11726
SVG Image do not take into account clip/overflow when hit testing
https://bugs.webkit.org/show_bug.cgi?id=11726
Summary SVG Image do not take into account clip/overflow when hit testing
Rob Buis
Reported 2006-11-30 12:34:00 PST
SVG Images can be quite large and one might want to clip them. For instance http://www.carto.net/papers/svg/gui/scrollbar/index.svg show a nice example of large images that are clipped to a container. However it doesnt work well for ToT, whereas html images do not seem to have a problem.
Attachments
Testcase showing the problem (520 bytes, image/svg+xml)
2006-11-30 12:40 PST, Rob Buis
no flags
first attempt (12.65 KB, patch)
2006-12-01 15:19 PST, Rob Buis
oliver: review-
Improved patch (25.70 KB, patch)
2006-12-13 12:55 PST, Rob Buis
oliver: review+
Rob Buis
Comment 1 2006-11-30 12:40:25 PST
Created attachment 11690 [details] Testcase showing the problem This testcase clearly shows the problem. Please place in LayoutTests/svg/W3C-SVG-1.1/. Cheers, Rob.
Rob Buis
Comment 2 2006-12-01 15:19:21 PST
Created attachment 11708 [details] first attempt This patch fixes the testcase. I worked it into a nice layout test. Cheers, Rob.
Oliver Hunt
Comment 3 2006-12-02 16:44:56 PST
Comment on attachment 11708 [details] first attempt SVGContainer can be <svg> <use> or <g> all of which can have transforms. As far as i can make out you don't account for this. Other than that everything looks fine, so if my concern is unfounded this can be r+
Rob Buis
Comment 4 2006-12-13 12:55:46 PST
Created attachment 11832 [details] Improved patch Make it compile against ToT. Also make it work for <svg>s that set x and y to something other than 0. The testscase now tests this. Cheers, Rob.
Oliver Hunt
Comment 5 2006-12-13 14:08:06 PST
Comment on attachment 11832 [details] Improved patch RenderSVGContainer::nodeAtPoint you're still doing a check to ensure only svg elements get transforms applied, but to my knowledge <g> and <use> can both have transforms which you need to honour.
Rob Buis
Comment 6 2006-12-13 14:20:22 PST
Hi Oliver, (In reply to comment #5) > (From update of attachment 11832 [details] [edit]) > RenderSVGContainer::nodeAtPoint you're still doing a check to ensure only svg > elements get transforms applied, but to my knowledge <g> and <use> can both > have transforms which you need to honour. Hmm, that is true. But note that this particular bug is about clip/overflow, something which <g> can't have. <use> doesnt really "exist" right now, it just creates a RenderSVGContainer or RenderSVGImage IIRC. So IMHO it may be worthwhile to (a) check whether there is a problem hit detecting a transformed <g> and contents and (b) if so, create a new bugreport for that, What do you think? Cheers, Rob.
Oliver Hunt
Comment 7 2006-12-14 02:02:50 PST
Comment on attachment 11832 [details] Improved patch my bad. File a bug on nodeAtPoint however. I don't think that will be correct in all cases
David Kilzer (:ddkilzer)
Comment 8 2006-12-14 03:44:24 PST
Commit by rwlbuis in r18210.
Note You need to log in before you can comment on or make changes to this bug.