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

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

Issue 921633007: Move the SVG container code from rendering/svg to layout/svg. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 30 matching lines...) Expand all
41 } 41 }
42 42
43 LayoutSVGContainer::~LayoutSVGContainer() 43 LayoutSVGContainer::~LayoutSVGContainer()
44 { 44 {
45 } 45 }
46 46
47 void LayoutSVGContainer::layout() 47 void LayoutSVGContainer::layout()
48 { 48 {
49 ASSERT(needsLayout()); 49 ASSERT(needsLayout());
50 50
51 // Allow RenderSVGViewportContainer to update its viewport. 51 // Allow LayoutSVGViewportContainer to update its viewport.
52 calcViewport(); 52 calcViewport();
53 53
54 // Allow RenderSVGTransformableContainer to update its transform. 54 // Allow LayoutSVGTransformableContainer to update its transform.
55 bool updatedTransform = calculateLocalTransform(); 55 bool updatedTransform = calculateLocalTransform();
56 56
57 // RenderSVGViewportContainer needs to set the 'layout size changed' flag. 57 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag.
58 determineIfLayoutSizeChanged(); 58 determineIfLayoutSizeChanged();
59 59
60 SVGLayoutSupport::layoutChildren(this, selfNeedsLayout() || SVGLayoutSupport ::filtersForceContainerLayout(this)); 60 SVGLayoutSupport::layoutChildren(this, selfNeedsLayout() || SVGLayoutSupport ::filtersForceContainerLayout(this));
61 61
62 // Invalidate all resources of this client if our layout changed. 62 // Invalidate all resources of this client if our layout changed.
63 if (everHadLayout() && needsLayout()) 63 if (everHadLayout() && needsLayout())
64 SVGResourcesCache::clientLayoutChanged(this); 64 SVGResourcesCache::clientLayoutChanged(this);
65 65
66 if (m_needsBoundariesUpdate || updatedTransform) { 66 if (m_needsBoundariesUpdate || updatedTransform) {
67 updateCachedBoundaries(); 67 updateCachedBoundaries();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 void LayoutSVGContainer::updateCachedBoundaries() 157 void LayoutSVGContainer::updateCachedBoundaries()
158 { 158 {
159 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); 159 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m _objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox);
160 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox); 160 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox);
161 } 161 }
162 162
163 bool LayoutSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 163 bool LayoutSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
164 { 164 {
165 // Give RenderSVGViewportContainer a chance to apply its viewport clip 165 // Give LayoutSVGViewportContainer a chance to apply its viewport clip
166 if (!pointIsInsideViewportClip(pointInParent)) 166 if (!pointIsInsideViewportClip(pointInParent))
167 return false; 167 return false;
168 168
169 FloatPoint localPoint; 169 FloatPoint localPoint;
170 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint)) 170 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint))
171 return false; 171 return false;
172 172
173 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) { 173 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin g()) {
174 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) { 174 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) {
175 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 175 updateHitTestResult(result, roundedLayoutPoint(localPoint));
176 return true; 176 return true;
177 } 177 }
178 } 178 }
179 179
180 // pointer-events=boundingBox makes it possible for containers to be direct targets 180 // pointer-events=boundingBox makes it possible for containers to be direct targets
181 if (style()->pointerEvents() == PE_BOUNDINGBOX) { 181 if (style()->pointerEvents() == PE_BOUNDINGBOX) {
182 ASSERT(isObjectBoundingBoxValid()); 182 ASSERT(isObjectBoundingBoxValid());
183 if (objectBoundingBox().contains(localPoint)) { 183 if (objectBoundingBox().contains(localPoint)) {
184 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 184 updateHitTestResult(result, roundedLayoutPoint(localPoint));
185 return true; 185 return true;
186 } 186 }
187 } 187 }
188 // 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." 188 // 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."
189 return false; 189 return false;
190 } 190 }
191 191
192 } 192 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGContainer.h ('k') | Source/core/layout/svg/LayoutSVGHiddenContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698