A click event handler on an SVG element positioned after an XHTML <br /> element does not get fired. Removing the <br /> makes the event handler work. See test case.
Created attachment 14847 [details] Test case for <br> before an <svg> element
Well, clearly the <br> is overlapping with the <svg> and capturing the click.
If you start the doc <body><br /><svg> the problem does not occur. So it seems to be an interaction between the <p> and the <br> which produces this <br /> overlap with the <svg>
More info: Using a <div> instead of an SVG does not show the bug. I expect that RenderSVGContainer is just not implementing some render tree method correctly.
Created attachment 14854 [details] Render tree comparisons (left=<p/><br/><svg>, right=<p/><br/><div/><svg>)
Hyatt might just know off the top of his head what's up here.
Created attachment 14857 [details] render tree for broken case
Well, I think we're applying the _tx, _ty twice. Possibly because we're doing it once in nodeAtPoint and a second time using absoluteTransform() (from inside mapAbsolutePointToLocal()). IMO the best way to go about fixing this is to cleanly divide the SVG render tree from the HTML render tree by finally separating out the "in HTML" code from RenderSVGContainer into a RenderSVGRoot class or similar. http://bugs.webkit.org/show_bug.cgi?id=12207 covers doing such. There might also be an easy way to fix this, I'm not sure. absoluteTransform() application is necessary to handle rotation etc. applying _tx, _ty is necessary due to handle scrolling. Again, I think this type of bug mostly just occurs due to the strange intermixing of HTML and SVG way of doing things in RenderSVGContainer (since RSC can be inside either html or svg content).
Created attachment 15084 [details] First attempt This should fix hit testing. Also the rects in the window inspector should be more accurate for svg renderers now. Cheers, Rob.
Comment on attachment 15084 [details] First attempt This line needs to be made more understandable: - if (child->nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction)) { + if (child->nodeAtPoint(request, result, _x - (_tx - ctm.e()), _y - (_ty - ctm.f()), 0, 0, hitTestAction)) { by breaking it out into more lines with better names. The code otherwise looks fine.
Created attachment 15114 [details] Addressing Eric's issue This one has a clear name for the calculated scroll offets. Cheers, Rob.
Comment on attachment 15114 [details] Addressing Eric's issue looks fine
Landed in r23583.