OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2009 Google, Inc. | 4 * Copyright (C) 2009 Google, Inc. |
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 13 matching lines...) Expand all Loading... |
24 #include "core/layout/svg/SVGLayoutSupport.h" | 24 #include "core/layout/svg/SVGLayoutSupport.h" |
25 #include "core/svg/SVGGElement.h" | 25 #include "core/svg/SVGGElement.h" |
26 #include "core/svg/SVGGraphicsElement.h" | 26 #include "core/svg/SVGGraphicsElement.h" |
27 #include "core/svg/SVGUseElement.h" | 27 #include "core/svg/SVGUseElement.h" |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 | 30 |
31 LayoutSVGTransformableContainer::LayoutSVGTransformableContainer(SVGGraphicsElem
ent* node) | 31 LayoutSVGTransformableContainer::LayoutSVGTransformableContainer(SVGGraphicsElem
ent* node) |
32 : LayoutSVGContainer(node) | 32 : LayoutSVGContainer(node) |
33 , m_needsTransformUpdate(true) | 33 , m_needsTransformUpdate(true) |
34 , m_didTransformToRootUpdate(false) | |
35 { | 34 { |
36 } | 35 } |
37 | 36 |
38 static bool hasValidPredecessor(const Node* node) | 37 static bool hasValidPredecessor(const Node* node) |
39 { | 38 { |
40 ASSERT(node); | 39 ASSERT(node); |
41 for (node = node->previousSibling(); node; node = node->previousSibling()) { | 40 for (node = node->previousSibling(); node; node = node->previousSibling()) { |
42 if (node->isSVGElement() && toSVGElement(node)->isValid()) | 41 if (node->isSVGElement() && toSVGElement(node)->isValid()) |
43 return true; | 42 return true; |
44 } | 43 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (useElement) { | 86 if (useElement) { |
88 SVGLengthContext lengthContext(useElement); | 87 SVGLengthContext lengthContext(useElement); |
89 FloatSize translation( | 88 FloatSize translation( |
90 useElement->x()->currentValue()->value(lengthContext), | 89 useElement->x()->currentValue()->value(lengthContext), |
91 useElement->y()->currentValue()->value(lengthContext)); | 90 useElement->y()->currentValue()->value(lengthContext)); |
92 if (translation != m_additionalTranslation) | 91 if (translation != m_additionalTranslation) |
93 m_needsTransformUpdate = true; | 92 m_needsTransformUpdate = true; |
94 m_additionalTranslation = translation; | 93 m_additionalTranslation = translation; |
95 } | 94 } |
96 | 95 |
97 m_didTransformToRootUpdate = m_needsTransformUpdate || SVGLayoutSupport::tra
nsformToRootChanged(parent()); | |
98 if (!m_needsTransformUpdate) | 96 if (!m_needsTransformUpdate) |
99 return false; | 97 return false; |
100 | 98 |
101 m_localTransform = element->calculateAnimatedLocalTransform(); | 99 m_localTransform = element->calculateAnimatedLocalTransform(); |
102 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran
slation.height()); | 100 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran
slation.height()); |
103 m_needsTransformUpdate = false; | 101 m_needsTransformUpdate = false; |
104 return true; | 102 return true; |
105 } | 103 } |
106 | 104 |
107 } // namespace blink | 105 } // namespace blink |
OLD | NEW |