OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 m_repaintBoundingBox.inflate(borderAndPaddingWidth()); | 391 m_repaintBoundingBox.inflate(borderAndPaddingWidth()); |
392 } | 392 } |
393 | 393 |
394 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated Offset, HitTestAction hitTestAction) | 394 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated Offset, HitTestAction hitTestAction) |
395 { | 395 { |
396 LayoutPoint pointInParent = locationInContainer.point() - toLayoutSize(accum ulatedOffset); | 396 LayoutPoint pointInParent = locationInContainer.point() - toLayoutSize(accum ulatedOffset); |
397 LayoutPoint pointInBorderBox = pointInParent - toLayoutSize(location()); | 397 LayoutPoint pointInBorderBox = pointInParent - toLayoutSize(location()); |
398 | 398 |
399 // Only test SVG content if the point is in our content box. | 399 // Only test SVG content if the point is in our content box. |
400 // FIXME: This should be an intersection when rect-based hit tests are suppo rted by nodeAtFloatPoint. | 400 // FIXME: This should be an intersection when rect-based hit tests are suppo rted by nodeAtFloatPoint. |
401 if (contentBoxRect().contains(pointInBorderBox)) { | 401 if (!request.touchAction() && contentBoxRect().contains(pointInBorderBox)) { |
Rick Byers
2014/01/17 16:12:46
RenderSVGRoot is a RenderBox so whatever we decide
gnana
2014/01/21 14:00:16
commented reply below
| |
402 FloatPoint localPoint = localToParentTransform().inverse().mapPoint(Floa tPoint(pointInParent)); | 402 FloatPoint localPoint = localToParentTransform().inverse().mapPoint(Floa tPoint(pointInParent)); |
403 | 403 |
404 for (RenderObject* child = lastChild(); child; child = child->previousSi bling()) { | 404 for (RenderObject* child = lastChild(); child; child = child->previousSi bling()) { |
405 // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet . | 405 // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet . |
406 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestActi on)) { | 406 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestActi on)) { |
407 updateHitTestResult(result, pointInBorderBox); | 407 updateHitTestResult(result, pointInBorderBox); |
408 if (!result.addNodeToRectBasedTestResult(child->node(), request, locationInContainer)) | 408 if (!result.addNodeToRectBasedTestResult(child->node(), request, locationInContainer)) |
409 return true; | 409 return true; |
410 } | 410 } |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 // If we didn't early exit above, we've just hit the container <svg> element . Unlike SVG 1.1, 2nd Edition allows container elements to be hit. | 414 // If we didn't early exit above, we've just hit the container <svg> element . Unlike SVG 1.1, 2nd Edition allows container elements to be hit. |
415 if (hitTestAction == HitTestBlockBackground && visibleToHitTestRequest(reque st)) { | 415 if (hitTestAction == HitTestBlockBackground && visibleToHitTestRequest(reque st)) { |
gnana
2014/01/21 14:00:16
Yes, but visibleToHitTestRequest is called only fo
Rick Byers
2014/01/21 15:24:20
Ah, I see! Is there any good reason not to call v
leviw_travelin_and_unemployed
2014/01/21 19:15:00
This matches what we do in RenderBlock.
| |
416 // Only return true here, if the last hit testing phase 'BlockBackground ' is executed. If we'd return true in the 'Foreground' phase, | 416 // Only return true here, if the last hit testing phase 'BlockBackground ' is executed. If we'd return true in the 'Foreground' phase, |
417 // hit testing would stop immediately. For SVG only trees this doesn't m atter. Though when we have a <foreignObject> subtree we need | 417 // hit testing would stop immediately. For SVG only trees this doesn't m atter. Though when we have a <foreignObject> subtree we need |
418 // to be able to detect hits on the background of a <div> element. If we 'd return true here in the 'Foreground' phase, we are not able | 418 // to be able to detect hits on the background of a <div> element. If we 'd return true here in the 'Foreground' phase, we are not able |
419 // to detect these hits anymore. | 419 // to detect these hits anymore. |
420 LayoutRect boundsRect(accumulatedOffset + location(), size()); | 420 LayoutRect boundsRect(accumulatedOffset + location(), size()); |
421 if (locationInContainer.intersects(boundsRect)) { | 421 if (locationInContainer.intersects(boundsRect)) { |
422 updateHitTestResult(result, pointInBorderBox); | 422 updateHitTestResult(result, pointInBorderBox); |
423 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect)) | 423 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect)) |
424 return true; | 424 return true; |
425 } | 425 } |
(...skipping 19 matching lines...) Expand all Loading... | |
445 | 445 |
446 bool RenderSVGRoot::hasRelativeLogicalHeight() const | 446 bool RenderSVGRoot::hasRelativeLogicalHeight() const |
447 { | 447 { |
448 SVGSVGElement* svg = toSVGSVGElement(node()); | 448 SVGSVGElement* svg = toSVGSVGElement(node()); |
449 ASSERT(svg); | 449 ASSERT(svg); |
450 | 450 |
451 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); | 451 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); |
452 } | 452 } |
453 | 453 |
454 } | 454 } |
OLD | NEW |