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

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

Issue 2436793002: Simplify SVGAnimated* initialization (Closed)
Patch Set: Created 4 years, 2 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 baseValue()->setInvalid(); 54 baseValue()->setInvalid();
55 } 55 }
56 return parseStatus; 56 return parseStatus;
57 } 57 }
58 58
59 SVGFitToViewBox::SVGFitToViewBox(SVGElement* element, 59 SVGFitToViewBox::SVGFitToViewBox(SVGElement* element,
60 PropertyMapPolicy propertyMapPolicy) 60 PropertyMapPolicy propertyMapPolicy)
61 : m_viewBox(SVGAnimatedViewBoxRect::create(element)), 61 : m_viewBox(SVGAnimatedViewBoxRect::create(element)),
62 m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create( 62 m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(
63 element, 63 element,
64 SVGNames::preserveAspectRatioAttr, 64 SVGNames::preserveAspectRatioAttr)) {
65 SVGPreserveAspectRatio::create())) {
66 ASSERT(element); 65 ASSERT(element);
67 if (propertyMapPolicy == PropertyMapPolicyAdd) { 66 if (propertyMapPolicy == PropertyMapPolicyAdd) {
68 element->addToPropertyMap(m_viewBox); 67 element->addToPropertyMap(m_viewBox);
69 element->addToPropertyMap(m_preserveAspectRatio); 68 element->addToPropertyMap(m_preserveAspectRatio);
70 } 69 }
71 } 70 }
72 71
73 DEFINE_TRACE(SVGFitToViewBox) { 72 DEFINE_TRACE(SVGFitToViewBox) {
74 visitor->trace(m_viewBox); 73 visitor->trace(m_viewBox);
75 visitor->trace(m_preserveAspectRatio); 74 visitor->trace(m_preserveAspectRatio);
(...skipping 17 matching lines...) Expand all
93 return attrName == SVGNames::viewBoxAttr || 92 return attrName == SVGNames::viewBoxAttr ||
94 attrName == SVGNames::preserveAspectRatioAttr; 93 attrName == SVGNames::preserveAspectRatioAttr;
95 } 94 }
96 95
97 void SVGFitToViewBox::updateViewBox(const FloatRect& rect) { 96 void SVGFitToViewBox::updateViewBox(const FloatRect& rect) {
98 ASSERT(m_viewBox); 97 ASSERT(m_viewBox);
99 m_viewBox->baseValue()->setValue(rect); 98 m_viewBox->baseValue()->setValue(rect);
100 } 99 }
101 100
102 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698