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

Side by Side Diff: Source/core/rendering/svg/RenderSVGImage.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) 2006 Alexander Kellett <lypanov@kde.org> 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org>
6 * Copyright (C) 2009 Google, Inc. 6 * Copyright (C) 2009 Google, Inc.
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 182 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
183 { 183 {
184 // We only draw in the forground phase, so we only hit-test then. 184 // We only draw in the forground phase, so we only hit-test then.
185 if (hitTestAction != HitTestForeground) 185 if (hitTestAction != HitTestForeground)
186 return false; 186 return false;
187 187
188 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style()->pointerEvents()); 188 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style()->pointerEvents());
189 bool isVisible = (style()->visibility() == VISIBLE); 189 bool isVisible = (style()->visibility() == VISIBLE);
190 if (isVisible || !hitRules.requireVisible) { 190 if (isVisible || !hitRules.requireVisible) {
191 FloatPoint localPoint = localToParentTransform().inverse().mapPoint(poin tInParent); 191 FloatPoint localPoint;
192 192 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localT oParentTransform(), pointInParent, localPoint))
193 if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
194 return false; 193 return false;
195 194
196 if (hitRules.canHitFill || hitRules.canHitBoundingBox) { 195 if (hitRules.canHitFill || hitRules.canHitBoundingBox) {
197 if (m_objectBoundingBox.contains(localPoint)) { 196 if (m_objectBoundingBox.contains(localPoint)) {
198 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 197 updateHitTestResult(result, roundedLayoutPoint(localPoint));
199 return true; 198 return true;
200 } 199 }
201 } 200 }
202 } 201 }
203 202
(...skipping 22 matching lines...) Expand all
226 225
227 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*) 226 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*)
228 { 227 {
229 // this is called from paint() after the localTransform has already been app lied 228 // this is called from paint() after the localTransform has already been app lied
230 IntRect contentRect = enclosingIntRect(paintInvalidationRectInLocalCoordinat es()); 229 IntRect contentRect = enclosingIntRect(paintInvalidationRectInLocalCoordinat es());
231 if (!contentRect.isEmpty()) 230 if (!contentRect.isEmpty())
232 rects.append(contentRect); 231 rects.append(contentRect);
233 } 232 }
234 233
235 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGForeignObject.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698