Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(805)

Side by Side Diff: Source/core/rendering/svg/SVGInlineTextBox.cpp

Issue 45733010: Add pointer-events="bounding-box" for svg content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make assert more specific Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.cpp ('k') | Source/devtools/front_end/CSSMetadata.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.cpp ('k') | Source/devtools/front_end/CSSMetadata.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698