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

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

Issue 2573653003: Remove LayoutSVGViewportContainer's calcViewport and pointIsInsideViewportClip (Closed)
Patch Set: Add code and TODO about removing setNeeds calls Created 4 years 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 28 matching lines...) Expand all
39 m_didScreenScaleFactorChange(false), 39 m_didScreenScaleFactorChange(false),
40 m_hasNonIsolatedBlendingDescendants(false), 40 m_hasNonIsolatedBlendingDescendants(false),
41 m_hasNonIsolatedBlendingDescendantsDirty(false) {} 41 m_hasNonIsolatedBlendingDescendantsDirty(false) {}
42 42
43 LayoutSVGContainer::~LayoutSVGContainer() {} 43 LayoutSVGContainer::~LayoutSVGContainer() {}
44 44
45 void LayoutSVGContainer::layout() { 45 void LayoutSVGContainer::layout() {
46 ASSERT(needsLayout()); 46 ASSERT(needsLayout());
47 LayoutAnalyzer::Scope analyzer(*this); 47 LayoutAnalyzer::Scope analyzer(*this);
48 48
49 // Allow LayoutSVGViewportContainer to update its viewport.
50 calcViewport();
51
52 // Allow LayoutSVGTransformableContainer to update its transform. 49 // Allow LayoutSVGTransformableContainer to update its transform.
fs 2016/12/13 10:11:23 Nit: Maybe update this comment too (like in the he
pdr. 2016/12/13 19:48:55 Done. Went with a generic "Update the local transf
53 SVGTransformChange transformChange = calculateLocalTransform(); 50 SVGTransformChange transformChange = calculateLocalTransform();
54 m_didScreenScaleFactorChange = 51 m_didScreenScaleFactorChange =
55 transformChange == SVGTransformChange::Full || 52 transformChange == SVGTransformChange::Full ||
56 SVGLayoutSupport::screenScaleFactorChanged(parent()); 53 SVGLayoutSupport::screenScaleFactorChanged(parent());
57 54
58 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. 55 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag.
59 determineIfLayoutSizeChanged(); 56 determineIfLayoutSizeChanged();
60 57
61 // When hasRelativeLengths() is false, no descendants have relative lengths 58 // When hasRelativeLengths() is false, no descendants have relative lengths
62 // (hence no one is interested in viewport size changes). 59 // (hence no one is interested in viewport size changes).
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 SVGLayoutSupport::computeContainerBoundingBoxes( 172 SVGLayoutSupport::computeContainerBoundingBoxes(
176 this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, 173 this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox,
177 m_localVisualRect); 174 m_localVisualRect);
178 if (element()) 175 if (element())
179 element()->setNeedsResizeObserverUpdate(); 176 element()->setNeedsResizeObserverUpdate();
180 } 177 }
181 178
182 bool LayoutSVGContainer::nodeAtFloatPoint(HitTestResult& result, 179 bool LayoutSVGContainer::nodeAtFloatPoint(HitTestResult& result,
183 const FloatPoint& pointInParent, 180 const FloatPoint& pointInParent,
184 HitTestAction hitTestAction) { 181 HitTestAction hitTestAction) {
185 // Give LayoutSVGViewportContainer a chance to apply its viewport clip
186 if (!pointIsInsideViewportClip(pointInParent))
187 return false;
188
189 FloatPoint localPoint; 182 FloatPoint localPoint;
190 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping( 183 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(
191 *this, localToSVGParentTransform(), pointInParent, localPoint)) 184 *this, localToSVGParentTransform(), pointInParent, localPoint))
192 return false; 185 return false;
193 186
194 for (LayoutObject* child = lastChild(); child; 187 for (LayoutObject* child = lastChild(); child;
195 child = child->previousSibling()) { 188 child = child->previousSibling()) {
196 if (child->nodeAtFloatPoint(result, localPoint, hitTestAction)) { 189 if (child->nodeAtFloatPoint(result, localPoint, hitTestAction)) {
197 const LayoutPoint& localLayoutPoint = LayoutPoint(localPoint); 190 const LayoutPoint& localLayoutPoint = LayoutPoint(localPoint);
198 updateHitTestResult(result, localLayoutPoint); 191 updateHitTestResult(result, localLayoutPoint);
(...skipping 21 matching lines...) Expand all
220 // under the pointer (i.e., there is no target element), the event is not 213 // under the pointer (i.e., there is no target element), the event is not
221 // dispatched." 214 // dispatched."
222 return false; 215 return false;
223 } 216 }
224 217
225 SVGTransformChange LayoutSVGContainer::calculateLocalTransform() { 218 SVGTransformChange LayoutSVGContainer::calculateLocalTransform() {
226 return SVGTransformChange::None; 219 return SVGTransformChange::None;
227 } 220 }
228 221
229 } // namespace blink 222 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698