OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |