Reviewed by rwlbuis.
Test: svg/custom/inner-svg-hit-test.svg
* rendering/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtPoint): never allow containers to be hit.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18907
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-01-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by rwlbuis.
+
+ * svg/custom/inner-svg-hit-test-expected.checksum: Added.
+ * svg/custom/inner-svg-hit-test-expected.png: Added.
+ * svg/custom/inner-svg-hit-test-expected.txt: Added.
+ * svg/custom/inner-svg-hit-test.svg: Added.
+
2007-01-17 Eric Seidel <eric@webkit.org>
Reviewed by mitz and rwlbuis.
--- /dev/null
+16310588467cfc20d551635abc59b784
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+ RenderSVGContainer {svg} at (0,0) size 100x100
+ RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
+ RenderSVGContainer {svg} at (0,0) size 0x0
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <rect id="rect" width="100" height="100" fill="red" />
+ <svg onclick="hit()">
+ </svg>
+ <script>
+ <![CDATA[
+ var hitDetected = 0;
+ function hit() {
+ hitDetected = 1;
+ }
+
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(200, 200);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ if (hitDetected == 0) {
+ document.getElementById('rect').style.fill = 'green';
+ }
+ }
+ ]]>
+ </script>
+</svg>
+2007-01-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by rwlbuis.
+
+ Test: svg/custom/inner-svg-hit-test.svg
+
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::nodeAtPoint): never allow containers to be hit.
+
2007-01-17 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
return false;
}
- return RenderContainer::nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction);
+ for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
+ if (child->nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction)) {
+ updateHitTestResult(result, IntPoint(_x - _tx, _y - _ty));
+ return true;
+ }
+ }
+
+ // Spec: Only graphical elements can be targeted by the mouse, period.
+ // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
+ return false;
}
}