+2007-06-19 Rob Buis <buis@kde.org>
+
+ Reviewed by Oliver.
+
+ Testcase for:
+ http://bugs.webkit.org/show_bug.cgi?id=14144
+ All tx/ty (parentX/parentY) usage should be removed from SVG renders
+ http://bugs.webkit.org/show_bug.cgi?id=13981
+ <br> prevents click handler from firing
+
+ The updated testcases are improvements.
+
+ * svg/custom/hit-test-with-br-expected.checksum: Added.
+ * svg/custom/hit-test-with-br-expected.png: Added.
+ * svg/custom/hit-test-with-br-expected.txt: Added.
+ * svg/custom/hit-test-with-br.xhtml: Added.
+ * svg/custom/image-parent-translation-expected.txt:
+ * svg/custom/invisible-text-after-scrolling-expected.txt:
+ * svg/custom/second-inline-text-expected.txt:
+ * svg/custom/svg-float-border-padding-expected.txt:
+
2007-06-16 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Eric.
--- /dev/null
+ee70b85e23c655a5c55a28d92c8e199f
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x95
+ RenderBlock {html} at (0,0) size 800x95
+ RenderBody {body} at (8,16) size 784x71
+ RenderBlock {p} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 658x18
+ text run at (0,0) width 435: "A test for hit testing when an svg container is relatively positioned in "
+ text run at (435,0) width 223: "a containing block. See bug 13981."
+ RenderBlock (anonymous) at (0,34) size 784x37
+ RenderBR {br} at (0,0) size 0x18
+ RenderSVGContainer {svg} at (8,68) size 720x15
+ RenderPath {rect} at (8,68) size 720x15 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L720.00,0.00L720.00,15.00L0.00,15.00"]
+ RenderText {#text} at (0,0) size 0x0
+caret: position 0 of child 3 {br} of child 3 {body} of child 0 {html} of document
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+<title><br> prevents click handler from firing</title>
+<script>
+function clickHandler(evt)
+{
+ evt.target.style.fill = "green";
+}
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function doClick() {
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(10, 70);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ layoutTestController.notifyDone();
+ }
+}
+
+setTimeout("doClick()", 0);
+</script>
+ </head>
+ <body>
+ <p>
+ A test for hit testing when an svg container is relatively positioned in
+ a containing block. See bug 13981.
+ </p>
+ <br />
+ <svg xmlns="http://www.w3.org/2000/svg" width="720" height="15">
+ <rect width="720" height="15" onclick="clickHandler(evt)" />
+ </svg>
+ </body>
+</html>
RenderText {#text} at (0,0) size 0x0
RenderInline {div} at (0,0) size 75x18
RenderText {#text} at (0,0) size 0x0
- RenderSVGContainer {svg} at (5,128) size 81x81
+ RenderSVGContainer {svg} at (84,128) size 81x81
RenderImage {image} at (0,0) size 75x75
- RenderPath {rect} at (5,128) size 81x81 [stroke={[type=SOLID] [color=#FF0000] [stroke width=6.00]}] [data="M0.00,0.00L75.00,0.00L75.00,75.00L0.00,75.00"]
+ RenderPath {rect} at (84,128) size 81x81 [stroke={[type=SOLID] [color=#FF0000] [stroke width=6.00]}] [data="M0.00,0.00L75.00,0.00L75.00,75.00L0.00,75.00"]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
+2007-06-19 Rob Buis <buis@kde.org>
+
+ Reviewed by Oliver.
+
+ http://bugs.webkit.org/show_bug.cgi?id=14144
+ All tx/ty (parentX/parentY) usage should be removed from SVG renders
+ http://bugs.webkit.org/show_bug.cgi?id=13981
+ <br> prevents click handler from firing
+
+ Fix the hit testing issues by making RenderSVGRoot take its m_x, m_y
+ into account in the absolute transform.
+
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::absoluteRects):
+ (WebCore::RenderPath::nodeAtPoint):
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::nodeAtPoint):
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::absoluteTransform):
+ (WebCore::RenderSVGRoot::nodeAtPoint):
+
2007-06-16 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Eric.
graphicsContext->addFocusRingRect(IntRect(boundingBox.x(), boundingBox.y(), boundingBox.width(), boundingBox.height()));
}
-void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty, bool)
+void RenderPath::absoluteRects(Vector<IntRect>& rects, int, int, bool)
{
rects.append(absoluteClippedOverflowRect());
}
-bool RenderPath::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderPath::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int, int, HitTestAction hitTestAction)
{
// We only draw in the forground phase, so we only hit-test then.
if (hitTestAction != HitTestForeground)
return false;
- IntPoint absolutePoint(_x - _tx, _y - _ty);
+ IntPoint absolutePoint(_x, _y);
PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, style()->svgStyle()->pointerEvents());
{
return static_cast<SVGStyledElement*>(element())->hasRelativeValues();
}
-
+
}
#endif // ENABLE(SVG)
paintInfo.context->restore();
}
-bool RenderSVGImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderSVGImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int, int, HitTestAction hitTestAction)
{
// We only draw in the forground phase, so we only hit-test then.
if (hitTestAction != HitTestForeground)
AffineTransform RenderSVGRoot::absoluteTransform() const
{
AffineTransform ctm = RenderContainer::absoluteTransform();
+ ctm.translate(m_x, m_y);
SVGSVGElement* svg = static_cast<SVGSVGElement*>(element());
ctm.scale(svg->currentScale());
ctm.translate(svg->currentTranslate().x(), svg->currentTranslate().y());
bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
+ AffineTransform ctm = RenderContainer::absoluteTransform();
if (!viewport().isEmpty()
&& style()->overflowX() == OHIDDEN
&& style()->overflowY() == OHIDDEN) {
// Check if we need to do anything at all.
IntRect overflowBox = overflowRect(false);
overflowBox.move(tx, ty);
- AffineTransform ctm = RenderContainer::absoluteTransform();
ctm.translate(viewport().x(), viewport().y());
double localX, localY;
ctm.inverse().map(_x - _tx, _y - _ty, &localX, &localY);
return false;
}
+ int sx = (_tx - ctm.e()); // scroll offset
+ int sy = (_ty - ctm.f()); // scroll offset
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
- if (child->nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction)) {
+ if (child->nodeAtPoint(request, result, _x - sx, _y - sy, 0, 0, hitTestAction)) {
updateHitTestResult(result, IntPoint(_x - _tx, _y - _ty));
return true;
}