Commit 9110e98a authored by eseidel's avatar eseidel

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.


git-svn-id: svn://svn.chromium.org/blink/trunk@18907 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent abae98ee
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.
16310588467cfc20d551635abc59b784
\ No newline at end of file
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
<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
......
......@@ -418,7 +418,16 @@ bool RenderSVGContainer::nodeAtPoint(const HitTestRequest& request, HitTestResul
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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment