OLD | NEW |
---|---|
1 /** | 1 /** |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 } | 731 } |
732 | 732 |
733 bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumula tedOffset, LayoutUnit, LayoutUnit) | 733 bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumula tedOffset, LayoutUnit, LayoutUnit) |
734 { | 734 { |
735 // FIXME: integrate with InlineTextBox::nodeAtPoint better. | 735 // FIXME: integrate with InlineTextBox::nodeAtPoint better. |
736 ASSERT(!isLineBreak()); | 736 ASSERT(!isLineBreak()); |
737 | 737 |
738 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r equest, renderer()->style()->pointerEvents()); | 738 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r equest, renderer()->style()->pointerEvents()); |
739 bool isVisible = renderer()->style()->visibility() == VISIBLE; | 739 bool isVisible = renderer()->style()->visibility() == VISIBLE; |
740 if (isVisible || !hitRules.requireVisible) { | 740 if (isVisible || !hitRules.requireVisible) { |
741 if ((hitRules.canHitStroke && (renderer()->style()->svgStyle()->hasStrok e() || !hitRules.requireStroke)) | 741 if (hitRules.canHitBoundingBox |
pdr.
2013/11/01 03:42:00
I think the 1.2 spec requires that hit testing wor
Erik Dahlström (inactive)
2013/11/29 16:30:48
PointerEventsHitRules.requireVisible is always fal
| |
742 || (hitRules.canHitStroke && (renderer()->style()->svgStyle()->hasSt roke() || !hitRules.requireStroke)) | |
742 || (hitRules.canHitFill && (renderer()->style()->svgStyle()->hasFill () || !hitRules.requireFill))) { | 743 || (hitRules.canHitFill && (renderer()->style()->svgStyle()->hasFill () || !hitRules.requireFill))) { |
743 FloatPoint boxOrigin(x(), y()); | 744 FloatPoint boxOrigin(x(), y()); |
744 boxOrigin.moveBy(accumulatedOffset); | 745 boxOrigin.moveBy(accumulatedOffset); |
745 FloatRect rect(boxOrigin, size()); | 746 FloatRect rect(boxOrigin, size()); |
746 if (locationInContainer.intersects(rect)) { | 747 if (locationInContainer.intersects(rect)) { |
747 renderer()->updateHitTestResult(result, locationInContainer.poin t() - toLayoutSize(accumulatedOffset)); | 748 renderer()->updateHitTestResult(result, locationInContainer.poin t() - toLayoutSize(accumulatedOffset)); |
748 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req uest, locationInContainer, rect)) | 749 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req uest, locationInContainer, rect)) |
749 return true; | 750 return true; |
750 } | 751 } |
751 } | 752 } |
752 } | 753 } |
753 return false; | 754 return false; |
754 } | 755 } |
755 | 756 |
756 } // namespace WebCore | 757 } // namespace WebCore |
OLD | NEW |