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

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

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (!contentRect.isEmpty()) 155 if (!contentRect.isEmpty())
156 rects.append(contentRect); 156 rects.append(contentRect);
157 } 157 }
158 158
159 void LayoutSVGContainer::updateCachedBoundaries() 159 void LayoutSVGContainer::updateCachedBoundaries()
160 { 160 {
161 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); 161 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox);
162 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox); 162 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox);
163 } 163 }
164 164
165 bool LayoutSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 165 bool LayoutSVGContainer::nodeAtFloatPoint(HitTestResult& result, const FloatPoin t& pointInParent, HitTestAction hitTestAction)
166 { 166 {
167 // Give LayoutSVGViewportContainer a chance to apply its viewport clip 167 // Give LayoutSVGViewportContainer a chance to apply its viewport clip
168 if (!pointIsInsideViewportClip(pointInParent)) 168 if (!pointIsInsideViewportClip(pointInParent))
169 return false; 169 return false;
170 170
171 FloatPoint localPoint; 171 FloatPoint localPoint;
172 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint)) 172 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint))
173 return false; 173 return false;
174 174
175 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) { 175 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) {
176 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) { 176 if (child->nodeAtFloatPoint(result, localPoint, hitTestAction)) {
177 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 177 updateHitTestResult(result, roundedLayoutPoint(localPoint));
178 return true; 178 return true;
179 } 179 }
180 } 180 }
181 181
182 // pointer-events=boundingBox makes it possible for containers to be direct targets 182 // pointer-events=boundingBox makes it possible for containers to be direct targets
183 if (style()->pointerEvents() == PE_BOUNDINGBOX) { 183 if (style()->pointerEvents() == PE_BOUNDINGBOX) {
184 ASSERT(isObjectBoundingBoxValid()); 184 ASSERT(isObjectBoundingBoxValid());
185 if (objectBoundingBox().contains(localPoint)) { 185 if (objectBoundingBox().contains(localPoint)) {
186 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 186 updateHitTestResult(result, roundedLayoutPoint(localPoint));
187 return true; 187 return true;
188 } 188 }
189 } 189 }
190 // 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." 190 // 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."
191 return false; 191 return false;
192 } 192 }
193 193
194 } 194 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGContainer.h ('k') | Source/core/layout/svg/LayoutSVGForeignObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698