| 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/rendering/svg/RenderSVGTransformableContainer.h" | 24 #include "core/rendering/svg/RenderSVGTransformableContainer.h" |
| 25 | 25 |
| 26 #include "core/layout/svg/SVGLayoutSupport.h" | 26 #include "core/layout/svg/SVGLayoutSupport.h" |
| 27 #include "core/svg/SVGGElement.h" | 27 #include "core/svg/SVGGElement.h" |
| 28 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
| 29 #include "core/svg/SVGUseElement.h" | 29 #include "core/svg/SVGUseElement.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElem
ent* node) | 33 RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElem
ent* node) |
| 34 : RenderSVGContainer(node) | 34 : LayoutSVGContainer(node) |
| 35 , m_needsTransformUpdate(true) | 35 , m_needsTransformUpdate(true) |
| 36 , m_didTransformToRootUpdate(false) | 36 , m_didTransformToRootUpdate(false) |
| 37 { | 37 { |
| 38 } | 38 } |
| 39 | 39 |
| 40 static bool hasValidPredecessor(const Node* node) | 40 static bool hasValidPredecessor(const Node* node) |
| 41 { | 41 { |
| 42 ASSERT(node); | 42 ASSERT(node); |
| 43 for (node = node->previousSibling(); node; node = node->previousSibling()) { | 43 for (node = node->previousSibling(); node; node = node->previousSibling()) { |
| 44 if (node->isSVGElement() && toSVGElement(node)->isValid()) | 44 if (node->isSVGElement() && toSVGElement(node)->isValid()) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 if (hasValidPredecessor(node)) | 59 if (hasValidPredecessor(node)) |
| 60 return false; | 60 return false; |
| 61 } else if (isSVGAElement(*element())) { | 61 } else if (isSVGAElement(*element())) { |
| 62 // http://www.w3.org/2003/01/REC-SVG11-20030114-errata#linking-text-envi
ronment | 62 // http://www.w3.org/2003/01/REC-SVG11-20030114-errata#linking-text-envi
ronment |
| 63 // The 'a' element may contain any element that its parent may contain,
except itself. | 63 // The 'a' element may contain any element that its parent may contain,
except itself. |
| 64 if (isSVGAElement(*child->node())) | 64 if (isSVGAElement(*child->node())) |
| 65 return false; | 65 return false; |
| 66 if (parent() && parent()->isSVG()) | 66 if (parent() && parent()->isSVG()) |
| 67 return parent()->isChildAllowed(child, style); | 67 return parent()->isChildAllowed(child, style); |
| 68 } | 68 } |
| 69 return RenderSVGContainer::isChildAllowed(child, style); | 69 return LayoutSVGContainer::isChildAllowed(child, style); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool RenderSVGTransformableContainer::calculateLocalTransform() | 72 bool RenderSVGTransformableContainer::calculateLocalTransform() |
| 73 { | 73 { |
| 74 SVGGraphicsElement* element = toSVGGraphicsElement(this->element()); | 74 SVGGraphicsElement* element = toSVGGraphicsElement(this->element()); |
| 75 ASSERT(element); | 75 ASSERT(element); |
| 76 | 76 |
| 77 // If we're either the renderer for a <use> element, or for any <g> element
inside the shadow | 77 // If we're either the renderer for a <use> element, or for any <g> element
inside the shadow |
| 78 // tree, that was created during the use/symbol/svg expansion in SVGUseEleme
nt. These containers | 78 // tree, that was created during the use/symbol/svg expansion in SVGUseEleme
nt. These containers |
| 79 // need to respect the translations induced by their corresponding use eleme
nts x/y attributes. | 79 // need to respect the translations induced by their corresponding use eleme
nts x/y attributes. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 100 if (!m_needsTransformUpdate) | 100 if (!m_needsTransformUpdate) |
| 101 return false; | 101 return false; |
| 102 | 102 |
| 103 m_localTransform = element->calculateAnimatedLocalTransform(); | 103 m_localTransform = element->calculateAnimatedLocalTransform(); |
| 104 m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.heig
ht()); | 104 m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.heig
ht()); |
| 105 m_needsTransformUpdate = false; | 105 m_needsTransformUpdate = false; |
| 106 return true; | 106 return true; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } | 109 } |
| OLD | NEW |