OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 25 matching lines...) Expand all Loading... |
36 : LayoutSVGModelObject(node), | 36 : LayoutSVGModelObject(node), |
37 m_objectBoundingBoxValid(false), | 37 m_objectBoundingBoxValid(false), |
38 m_needsBoundariesUpdate(true), | 38 m_needsBoundariesUpdate(true), |
39 m_didScreenScaleFactorChange(false), | 39 m_didScreenScaleFactorChange(false), |
40 m_hasNonIsolatedBlendingDescendants(false), | 40 m_hasNonIsolatedBlendingDescendants(false), |
41 m_hasNonIsolatedBlendingDescendantsDirty(false) {} | 41 m_hasNonIsolatedBlendingDescendantsDirty(false) {} |
42 | 42 |
43 LayoutSVGContainer::~LayoutSVGContainer() {} | 43 LayoutSVGContainer::~LayoutSVGContainer() {} |
44 | 44 |
45 void LayoutSVGContainer::layout() { | 45 void LayoutSVGContainer::layout() { |
46 ASSERT(needsLayout()); | 46 DCHECK(needsLayout()); |
47 LayoutAnalyzer::Scope analyzer(*this); | 47 LayoutAnalyzer::Scope analyzer(*this); |
48 | 48 |
49 // Update the local transform in subclasses. | 49 // Update the local transform in subclasses. |
50 SVGTransformChange transformChange = calculateLocalTransform(); | 50 SVGTransformChange transformChange = calculateLocalTransform(); |
51 m_didScreenScaleFactorChange = | 51 m_didScreenScaleFactorChange = |
52 transformChange == SVGTransformChange::Full || | 52 transformChange == SVGTransformChange::Full || |
53 SVGLayoutSupport::screenScaleFactorChanged(parent()); | 53 SVGLayoutSupport::screenScaleFactorChanged(parent()); |
54 | 54 |
55 // When hasRelativeLengths() is false, no descendants have relative lengths | 55 // When hasRelativeLengths() is false, no descendants have relative lengths |
56 // (hence no one is interested in viewport size changes). | 56 // (hence no one is interested in viewport size changes). |
57 bool layoutSizeChanged = | 57 bool layoutSizeChanged = |
58 element()->hasRelativeLengths() && | 58 element()->hasRelativeLengths() && |
59 SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this); | 59 SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this); |
60 | 60 |
61 SVGLayoutSupport::layoutChildren( | 61 SVGLayoutSupport::layoutChildren( |
62 firstChild(), false, m_didScreenScaleFactorChange, layoutSizeChanged); | 62 firstChild(), false, m_didScreenScaleFactorChange, layoutSizeChanged); |
63 | 63 |
64 // Invalidate all resources of this client if our layout changed. | 64 // Invalidate all resources of this client if our layout changed. |
65 if (everHadLayout() && needsLayout()) | 65 if (everHadLayout() && needsLayout()) |
66 SVGResourcesCache::clientLayoutChanged(this); | 66 SVGResourcesCache::clientLayoutChanged(this); |
67 | 67 |
68 if (m_needsBoundariesUpdate || transformChange != SVGTransformChange::None) { | 68 if (m_needsBoundariesUpdate || transformChange != SVGTransformChange::None) { |
69 updateCachedBoundaries(); | 69 updateCachedBoundaries(); |
70 m_needsBoundariesUpdate = false; | 70 m_needsBoundariesUpdate = false; |
71 | 71 |
72 // If our bounds changed, notify the parents. | 72 // If our bounds changed, notify the parents. |
73 LayoutSVGModelObject::setNeedsBoundariesUpdate(); | 73 LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
74 } | 74 } |
75 | 75 |
76 ASSERT(!m_needsBoundariesUpdate); | 76 DCHECK(!m_needsBoundariesUpdate); |
77 clearNeedsLayout(); | 77 clearNeedsLayout(); |
78 } | 78 } |
79 | 79 |
80 void LayoutSVGContainer::addChild(LayoutObject* child, | 80 void LayoutSVGContainer::addChild(LayoutObject* child, |
81 LayoutObject* beforeChild) { | 81 LayoutObject* beforeChild) { |
82 LayoutSVGModelObject::addChild(child, beforeChild); | 82 LayoutSVGModelObject::addChild(child, beforeChild); |
83 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); | 83 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); |
84 | 84 |
85 bool shouldIsolateDescendants = | 85 bool shouldIsolateDescendants = |
86 (child->isBlendingAllowed() && child->style()->hasBlendMode()) || | 86 (child->isBlendingAllowed() && child->style()->hasBlendMode()) || |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // under the pointer (i.e., there is no target element), the event is not | 218 // under the pointer (i.e., there is no target element), the event is not |
219 // dispatched." | 219 // dispatched." |
220 return false; | 220 return false; |
221 } | 221 } |
222 | 222 |
223 SVGTransformChange LayoutSVGContainer::calculateLocalTransform() { | 223 SVGTransformChange LayoutSVGContainer::calculateLocalTransform() { |
224 return SVGTransformChange::None; | 224 return SVGTransformChange::None; |
225 } | 225 } |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
OLD | NEW |