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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Allow LayoutSVGViewportContainer to update its viewport. | 53 // Allow LayoutSVGViewportContainer to update its viewport. |
54 calcViewport(); | 54 calcViewport(); |
55 | 55 |
56 // Allow LayoutSVGTransformableContainer to update its transform. | 56 // Allow LayoutSVGTransformableContainer to update its transform. |
57 bool updatedTransform = calculateLocalTransform(); | 57 bool updatedTransform = calculateLocalTransform(); |
58 | 58 |
59 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. | 59 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. |
60 determineIfLayoutSizeChanged(); | 60 determineIfLayoutSizeChanged(); |
61 | 61 |
62 SVGLayoutSupport::layoutChildren(this, selfNeedsLayout() || SVGLayoutSupport
::filtersForceContainerLayout(this)); | 62 // If any of this container's children need to be laid out, and a filter is |
| 63 // applied to the container, we need to issue paint invalidations for all |
| 64 // the descendants. |
| 65 bool forceLayoutOfChildren = selfNeedsLayout() |
| 66 || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*thi
s)); |
| 67 SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren); |
63 | 68 |
64 // Invalidate all resources of this client if our layout changed. | 69 // Invalidate all resources of this client if our layout changed. |
65 if (everHadLayout() && needsLayout()) | 70 if (everHadLayout() && needsLayout()) |
66 SVGResourcesCache::clientLayoutChanged(this); | 71 SVGResourcesCache::clientLayoutChanged(this); |
67 | 72 |
68 if (m_needsBoundariesUpdate || updatedTransform) { | 73 if (m_needsBoundariesUpdate || updatedTransform) { |
69 updateCachedBoundaries(); | 74 updateCachedBoundaries(); |
70 m_needsBoundariesUpdate = false; | 75 m_needsBoundariesUpdate = false; |
71 | 76 |
72 // If our bounds changed, notify the parents. | 77 // If our bounds changed, notify the parents. |
(...skipping 18 matching lines...) Expand all Loading... |
91 SVGResourcesCache::clientWillBeRemovedFromTree(child); | 96 SVGResourcesCache::clientWillBeRemovedFromTree(child); |
92 LayoutSVGModelObject::removeChild(child); | 97 LayoutSVGModelObject::removeChild(child); |
93 | 98 |
94 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); | 99 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); |
95 if (hadNonIsolatedDescendants) | 100 if (hadNonIsolatedDescendants) |
96 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); | 101 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); |
97 } | 102 } |
98 | 103 |
99 bool LayoutSVGContainer::selfWillPaint() const | 104 bool LayoutSVGContainer::selfWillPaint() const |
100 { | 105 { |
101 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
this); | 106 return SVGLayoutSupport::hasFilterResource(*this); |
102 return resources && resources->filter(); | |
103 } | 107 } |
104 | 108 |
105 void LayoutSVGContainer::styleDidChange(StyleDifference diff, const ComputedStyl
e* oldStyle) | 109 void LayoutSVGContainer::styleDidChange(StyleDifference diff, const ComputedStyl
e* oldStyle) |
106 { | 110 { |
107 LayoutSVGModelObject::styleDidChange(diff, oldStyle); | 111 LayoutSVGModelObject::styleDidChange(diff, oldStyle); |
108 | 112 |
109 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGLayoutSupport:
:willIsolateBlendingDescendantsForStyle(*oldStyle); | 113 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGLayoutSupport:
:willIsolateBlendingDescendantsForStyle(*oldStyle); |
110 bool isolationChanged = hadIsolation == !SVGLayoutSupport::willIsolateBlendi
ngDescendantsForObject(this); | 114 bool isolationChanged = hadIsolation == !SVGLayoutSupport::willIsolateBlendi
ngDescendantsForObject(this); |
111 | 115 |
112 if (!parent() || !isolationChanged) | 116 if (!parent() || !isolationChanged) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 updateHitTestResult(result, localLayoutPoint); | 191 updateHitTestResult(result, localLayoutPoint); |
188 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint)
== StopHitTesting) | 192 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint)
== StopHitTesting) |
189 return true; | 193 return true; |
190 } | 194 } |
191 } | 195 } |
192 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." | 196 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." |
193 return false; | 197 return false; |
194 } | 198 } |
195 | 199 |
196 } // namespace blink | 200 } // namespace blink |
OLD | NEW |