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

Side by Side Diff: Source/core/svg/SVGViewSpec.h

Issue 1051023006: Fix SVG animations which check viewBox attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix SVG animations which check viewBox attribute Created 5 years, 8 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) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 Rob Buis <buis@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); 70 bool parseViewSpecInternal(const CharType* ptr, const CharType* end);
71 71
72 RawPtrWillBeMember<SVGSVGElement> m_contextElement; 72 RawPtrWillBeMember<SVGSVGElement> m_contextElement;
73 RefPtrWillBeMember<SVGAnimatedTransformList> m_transform; 73 RefPtrWillBeMember<SVGAnimatedTransformList> m_transform;
74 String m_viewTargetString; 74 String m_viewTargetString;
75 }; 75 };
76 76
77 template <typename T> 77 template <typename T>
78 void SVGViewSpec::inheritViewAttributesFromElement(T* inheritFromElement) 78 void SVGViewSpec::inheritViewAttributesFromElement(T* inheritFromElement)
79 { 79 {
80 if (inheritFromElement->hasAttribute(SVGNames::viewBoxAttr)) 80 if (!inheritFromElement->hasEmptyViewBox())
81 viewBox()->baseValue()->setValue(inheritFromElement->viewBox()->currentV alue()->value()); 81 viewBox()->baseValue()->setValue(inheritFromElement->viewBox()->currentV alue()->value());
fs 2015/04/22 10:56:51 This will just snapshot the value, which likely me
82 82
83 if (inheritFromElement->hasAttribute(SVGNames::preserveAspectRatioAttr)) { 83 if (inheritFromElement->hasAttribute(SVGNames::preserveAspectRatioAttr)) {
84 preserveAspectRatio()->baseValue()->setAlign(inheritFromElement->preserv eAspectRatio()->currentValue()->align()); 84 preserveAspectRatio()->baseValue()->setAlign(inheritFromElement->preserv eAspectRatio()->currentValue()->align());
85 preserveAspectRatio()->baseValue()->setMeetOrSlice(inheritFromElement->p reserveAspectRatio()->currentValue()->meetOrSlice()); 85 preserveAspectRatio()->baseValue()->setMeetOrSlice(inheritFromElement->p reserveAspectRatio()->currentValue()->meetOrSlice());
86 } 86 }
87 87
88 if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr)) 88 if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr))
89 setZoomAndPan(inheritFromElement->zoomAndPan()); 89 setZoomAndPan(inheritFromElement->zoomAndPan());
90 } 90 }
91 91
92 } // namespace blink 92 } // namespace blink
93 93
94 #endif // SVGViewSpec_h 94 #endif // SVGViewSpec_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698