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

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

Issue 411613002: [SVG] Reject hit-test queries when the element has a singular transform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months 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 | Annotate | Revision Log
OLDNEW
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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008 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. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox); 163 SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox);
164 SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingB ox); 164 SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingB ox);
165 } 165 }
166 166
167 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 167 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
168 { 168 {
169 // Give RenderSVGViewportContainer a chance to apply its viewport clip 169 // Give RenderSVGViewportContainer a chance to apply its viewport clip
170 if (!pointIsInsideViewportClip(pointInParent)) 170 if (!pointIsInsideViewportClip(pointInParent))
171 return false; 171 return false;
172 172
173 FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInP arent); 173 FloatPoint localPoint;
174 174 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint))
175 if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
176 return false; 175 return false;
177 176
178 for (RenderObject* child = lastChild(); child; child = child->previousSiblin g()) { 177 for (RenderObject* child = lastChild(); child; child = child->previousSiblin g()) {
179 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) { 178 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) {
180 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 179 updateHitTestResult(result, roundedLayoutPoint(localPoint));
181 return true; 180 return true;
182 } 181 }
183 } 182 }
184 183
185 // pointer-events=boundingBox makes it possible for containers to be direct targets 184 // pointer-events=boundingBox makes it possible for containers to be direct targets
186 if (style()->pointerEvents() == PE_BOUNDINGBOX) { 185 if (style()->pointerEvents() == PE_BOUNDINGBOX) {
187 ASSERT(isObjectBoundingBoxValid()); 186 ASSERT(isObjectBoundingBoxValid());
188 if (objectBoundingBox().contains(localPoint)) { 187 if (objectBoundingBox().contains(localPoint)) {
189 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 188 updateHitTestResult(result, roundedLayoutPoint(localPoint));
190 return true; 189 return true;
191 } 190 }
192 } 191 }
193 // 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 dispat ched." 192 // 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 dispat ched."
194 return false; 193 return false;
195 } 194 }
196 195
197 } 196 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/hittest/singular-transform-7-expected.txt ('k') | Source/core/rendering/svg/RenderSVGForeignObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698