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

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

Issue 2478233002: Make 'transform' a presentation attribute on SVG elements (Closed)
Patch Set: Rebase 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, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } else { 157 } else {
158 if (!hitTestStrokeBoundingBox().contains(point)) 158 if (!hitTestStrokeBoundingBox().contains(point))
159 return false; 159 return false;
160 } 160 }
161 161
162 return shapeDependentStrokeContains(point); 162 return shapeDependentStrokeContains(point);
163 } 163 }
164 164
165 void LayoutSVGShape::updateLocalTransform() { 165 void LayoutSVGShape::updateLocalTransform() {
166 SVGGraphicsElement* graphicsElement = toSVGGraphicsElement(element()); 166 SVGGraphicsElement* graphicsElement = toSVGGraphicsElement(element());
167 if (graphicsElement->hasAnimatedLocalTransform()) { 167 if (graphicsElement->hasTransform(SVGElement::IncludeMotionTransform)) {
168 m_localTransform.setTransform( 168 m_localTransform.setTransform(graphicsElement->calculateTransform(
169 graphicsElement->calculateAnimatedLocalTransform()); 169 SVGElement::IncludeMotionTransform));
170 } else { 170 } else {
171 m_localTransform = AffineTransform(); 171 m_localTransform = AffineTransform();
172 } 172 }
173 } 173 }
174 174
175 void LayoutSVGShape::layout() { 175 void LayoutSVGShape::layout() {
176 LayoutAnalyzer::Scope analyzer(*this); 176 LayoutAnalyzer::Scope analyzer(*this);
177 177
178 // Invalidate all resources of this client if our layout changed. 178 // Invalidate all resources of this client if our layout changed.
179 if (everHadLayout() && selfNeedsLayout()) 179 if (everHadLayout() && selfNeedsLayout())
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 331 return lengthContext.valueForLength(style()->svgStyle().strokeWidth());
332 } 332 }
333 333
334 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { 334 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const {
335 if (!m_rareData) 335 if (!m_rareData)
336 m_rareData = makeUnique<LayoutSVGShapeRareData>(); 336 m_rareData = makeUnique<LayoutSVGShapeRareData>();
337 return *m_rareData.get(); 337 return *m_rareData.get();
338 } 338 }
339 339
340 } // namespace blink 340 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698