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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp

Issue 2234173002: Skip hit testing containers with invalid bounding boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/hittest/empty-container.html ('k') | no next file » | 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) 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) { 181 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) {
182 if (child->nodeAtFloatPoint(result, localPoint, hitTestAction)) { 182 if (child->nodeAtFloatPoint(result, localPoint, hitTestAction)) {
183 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ; 183 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ;
184 updateHitTestResult(result, localLayoutPoint); 184 updateHitTestResult(result, localLayoutPoint);
185 if (result.addNodeToListBasedTestResult(child->node(), localLayoutPo int) == StopHitTesting) 185 if (result.addNodeToListBasedTestResult(child->node(), localLayoutPo int) == StopHitTesting)
186 return true; 186 return true;
187 } 187 }
188 } 188 }
189 189
190 // pointer-events=boundingBox makes it possible for containers to be direct targets 190 // pointer-events: bounding-box makes it possible for containers to be direc t targets.
191 if (style()->pointerEvents() == PE_BOUNDINGBOX) { 191 if (style()->pointerEvents() == PE_BOUNDINGBOX) {
192 ASSERT(isObjectBoundingBoxValid()); 192 // Check for a valid bounding box because it will be invalid for empty c ontainers.
193 if (objectBoundingBox().contains(localPoint)) { 193 if (isObjectBoundingBoxValid() && objectBoundingBox().contains(localPoin t)) {
194 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ; 194 const LayoutPoint& localLayoutPoint = roundedLayoutPoint(localPoint) ;
195 updateHitTestResult(result, localLayoutPoint); 195 updateHitTestResult(result, localLayoutPoint);
196 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting) 196 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting)
197 return true; 197 return true;
198 } 198 }
199 } 199 }
200 // 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." 200 // 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."
201 return false; 201 return false;
202 } 202 }
203 203
204 SVGTransformChange LayoutSVGContainer::calculateLocalTransform() 204 SVGTransformChange LayoutSVGContainer::calculateLocalTransform()
205 { 205 {
206 return SVGTransformChange::None; 206 return SVGTransformChange::None;
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/hittest/empty-container.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698