| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 static inline SVGDocumentExtensions& svgExtensionsFromElement(SVGElement* elemen
t) | 34 static inline SVGDocumentExtensions& svgExtensionsFromElement(SVGElement* elemen
t) |
| 35 { | 35 { |
| 36 ASSERT(element); | 36 ASSERT(element); |
| 37 return element->document().accessSVGExtensions(); | 37 return element->document().accessSVGExtensions(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 LayoutSVGResourceContainer::LayoutSVGResourceContainer(SVGElement* node) | 40 LayoutSVGResourceContainer::LayoutSVGResourceContainer(SVGElement* node) |
| 41 : RenderSVGHiddenContainer(node) | 41 : LayoutSVGHiddenContainer(node) |
| 42 , m_isInLayout(false) | 42 , m_isInLayout(false) |
| 43 , m_id(node->getIdAttribute()) | 43 , m_id(node->getIdAttribute()) |
| 44 , m_invalidationMask(0) | 44 , m_invalidationMask(0) |
| 45 , m_registered(false) | 45 , m_registered(false) |
| 46 , m_isInvalidating(false) | 46 , m_isInvalidating(false) |
| 47 { | 47 { |
| 48 } | 48 } |
| 49 | 49 |
| 50 LayoutSVGResourceContainer::~LayoutSVGResourceContainer() | 50 LayoutSVGResourceContainer::~LayoutSVGResourceContainer() |
| 51 { | 51 { |
| 52 } | 52 } |
| 53 | 53 |
| 54 void LayoutSVGResourceContainer::layout() | 54 void LayoutSVGResourceContainer::layout() |
| 55 { | 55 { |
| 56 // FIXME: Investigate a way to detect and break resource layout dependency c
ycles early. | 56 // FIXME: Investigate a way to detect and break resource layout dependency c
ycles early. |
| 57 // Then we can remove this method altogether, and fall back onto RenderSVGHi
ddenContainer::layout(). | 57 // Then we can remove this method altogether, and fall back onto LayoutSVGHi
ddenContainer::layout(). |
| 58 ASSERT(needsLayout()); | 58 ASSERT(needsLayout()); |
| 59 if (m_isInLayout) | 59 if (m_isInLayout) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 TemporaryChange<bool> inLayoutChange(m_isInLayout, true); | 62 TemporaryChange<bool> inLayoutChange(m_isInLayout, true); |
| 63 | 63 |
| 64 RenderSVGHiddenContainer::layout(); | 64 LayoutSVGHiddenContainer::layout(); |
| 65 | 65 |
| 66 clearInvalidationMask(); | 66 clearInvalidationMask(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void LayoutSVGResourceContainer::willBeDestroyed() | 69 void LayoutSVGResourceContainer::willBeDestroyed() |
| 70 { | 70 { |
| 71 SVGResourcesCache::resourceDestroyed(this); | 71 SVGResourcesCache::resourceDestroyed(this); |
| 72 RenderSVGHiddenContainer::willBeDestroyed(); | 72 LayoutSVGHiddenContainer::willBeDestroyed(); |
| 73 if (m_registered) | 73 if (m_registered) |
| 74 svgExtensionsFromElement(element()).removeResource(m_id); | 74 svgExtensionsFromElement(element()).removeResource(m_id); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void LayoutSVGResourceContainer::styleDidChange(StyleDifference diff, const Layo
utStyle* oldStyle) | 77 void LayoutSVGResourceContainer::styleDidChange(StyleDifference diff, const Layo
utStyle* oldStyle) |
| 78 { | 78 { |
| 79 RenderSVGHiddenContainer::styleDidChange(diff, oldStyle); | 79 LayoutSVGHiddenContainer::styleDidChange(diff, oldStyle); |
| 80 | 80 |
| 81 if (!m_registered) { | 81 if (!m_registered) { |
| 82 m_registered = true; | 82 m_registered = true; |
| 83 registerResource(); | 83 registerResource(); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void LayoutSVGResourceContainer::idChanged() | 87 void LayoutSVGResourceContainer::idChanged() |
| 88 { | 88 { |
| 89 // Invalidate all our current clients. | 89 // Invalidate all our current clients. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // This will process the rest of the ancestors. | 290 // This will process the rest of the ancestors. |
| 291 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 291 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 292 break; | 292 break; |
| 293 } | 293 } |
| 294 | 294 |
| 295 current = current->parent(); | 295 current = current->parent(); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 } | 299 } |
| OLD | NEW |