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 14 matching lines...) Expand all Loading... |
25 #include "core/layout/svg/LayoutSVGContainer.h" | 25 #include "core/layout/svg/LayoutSVGContainer.h" |
26 | 26 |
27 #include "core/layout/svg/SVGLayoutSupport.h" | 27 #include "core/layout/svg/SVGLayoutSupport.h" |
28 #include "core/layout/svg/SVGResources.h" | 28 #include "core/layout/svg/SVGResources.h" |
29 #include "core/layout/svg/SVGResourcesCache.h" | 29 #include "core/layout/svg/SVGResourcesCache.h" |
30 #include "core/paint/SVGContainerPainter.h" | 30 #include "core/paint/SVGContainerPainter.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 LayoutSVGContainer::LayoutSVGContainer(SVGElement* node) | 34 LayoutSVGContainer::LayoutSVGContainer(SVGElement* node) |
35 : RenderSVGModelObject(node) | 35 : LayoutSVGModelObject(node) |
36 , m_objectBoundingBoxValid(false) | 36 , m_objectBoundingBoxValid(false) |
37 , m_needsBoundariesUpdate(true) | 37 , m_needsBoundariesUpdate(true) |
38 , m_hasNonIsolatedBlendingDescendants(false) | 38 , m_hasNonIsolatedBlendingDescendants(false) |
39 , m_hasNonIsolatedBlendingDescendantsDirty(false) | 39 , m_hasNonIsolatedBlendingDescendantsDirty(false) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 LayoutSVGContainer::~LayoutSVGContainer() | 43 LayoutSVGContainer::~LayoutSVGContainer() |
44 { | 44 { |
45 } | 45 } |
(...skipping 15 matching lines...) Expand all Loading... |
61 | 61 |
62 // Invalidate all resources of this client if our layout changed. | 62 // Invalidate all resources of this client if our layout changed. |
63 if (everHadLayout() && needsLayout()) | 63 if (everHadLayout() && needsLayout()) |
64 SVGResourcesCache::clientLayoutChanged(this); | 64 SVGResourcesCache::clientLayoutChanged(this); |
65 | 65 |
66 if (m_needsBoundariesUpdate || updatedTransform) { | 66 if (m_needsBoundariesUpdate || updatedTransform) { |
67 updateCachedBoundaries(); | 67 updateCachedBoundaries(); |
68 m_needsBoundariesUpdate = false; | 68 m_needsBoundariesUpdate = false; |
69 | 69 |
70 // If our bounds changed, notify the parents. | 70 // If our bounds changed, notify the parents. |
71 RenderSVGModelObject::setNeedsBoundariesUpdate(); | 71 LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
72 } | 72 } |
73 | 73 |
74 clearNeedsLayout(); | 74 clearNeedsLayout(); |
75 } | 75 } |
76 | 76 |
77 void LayoutSVGContainer::addChild(LayoutObject* child, LayoutObject* beforeChild
) | 77 void LayoutSVGContainer::addChild(LayoutObject* child, LayoutObject* beforeChild
) |
78 { | 78 { |
79 RenderSVGModelObject::addChild(child, beforeChild); | 79 LayoutSVGModelObject::addChild(child, beforeChild); |
80 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); | 80 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); |
81 | 81 |
82 bool shouldIsolateDescendants = (child->isBlendingAllowed() && child->style(
)->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); | 82 bool shouldIsolateDescendants = (child->isBlendingAllowed() && child->style(
)->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); |
83 if (shouldIsolateDescendants) | 83 if (shouldIsolateDescendants) |
84 descendantIsolationRequirementsChanged(DescendantIsolationRequired); | 84 descendantIsolationRequirementsChanged(DescendantIsolationRequired); |
85 } | 85 } |
86 | 86 |
87 void LayoutSVGContainer::removeChild(LayoutObject* child) | 87 void LayoutSVGContainer::removeChild(LayoutObject* child) |
88 { | 88 { |
89 SVGResourcesCache::clientWillBeRemovedFromTree(child); | 89 SVGResourcesCache::clientWillBeRemovedFromTree(child); |
90 RenderSVGModelObject::removeChild(child); | 90 LayoutSVGModelObject::removeChild(child); |
91 | 91 |
92 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); | 92 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); |
93 if (hadNonIsolatedDescendants) | 93 if (hadNonIsolatedDescendants) |
94 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); | 94 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); |
95 } | 95 } |
96 | 96 |
97 bool LayoutSVGContainer::selfWillPaint() | 97 bool LayoutSVGContainer::selfWillPaint() |
98 { | 98 { |
99 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
this); | 99 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
this); |
100 return resources && resources->filter(); | 100 return resources && resources->filter(); |
101 } | 101 } |
102 | 102 |
103 void LayoutSVGContainer::styleDidChange(StyleDifference diff, const LayoutStyle*
oldStyle) | 103 void LayoutSVGContainer::styleDidChange(StyleDifference diff, const LayoutStyle*
oldStyle) |
104 { | 104 { |
105 RenderSVGModelObject::styleDidChange(diff, oldStyle); | 105 LayoutSVGModelObject::styleDidChange(diff, oldStyle); |
106 | 106 |
107 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGLayoutSupport:
:willIsolateBlendingDescendantsForStyle(*oldStyle); | 107 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGLayoutSupport:
:willIsolateBlendingDescendantsForStyle(*oldStyle); |
108 bool isolationChanged = hadIsolation == !SVGLayoutSupport::willIsolateBlendi
ngDescendantsForObject(this); | 108 bool isolationChanged = hadIsolation == !SVGLayoutSupport::willIsolateBlendi
ngDescendantsForObject(this); |
109 | 109 |
110 if (!parent() || !isolationChanged) | 110 if (!parent() || !isolationChanged) |
111 return; | 111 return; |
112 | 112 |
113 if (hasNonIsolatedBlendingDescendants()) | 113 if (hasNonIsolatedBlendingDescendants()) |
114 parent()->descendantIsolationRequirementsChanged(SVGLayoutSupport::willI
solateBlendingDescendantsForObject(this) ? DescendantIsolationNeedsUpdate : Desc
endantIsolationRequired); | 114 parent()->descendantIsolationRequirementsChanged(SVGLayoutSupport::willI
solateBlendingDescendantsForObject(this) ? DescendantIsolationNeedsUpdate : Desc
endantIsolationRequired); |
115 } | 115 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 if (objectBoundingBox().contains(localPoint)) { | 183 if (objectBoundingBox().contains(localPoint)) { |
184 updateHitTestResult(result, roundedLayoutPoint(localPoint)); | 184 updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
185 return true; | 185 return true; |
186 } | 186 } |
187 } | 187 } |
188 // 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." | 188 // 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." |
189 return false; | 189 return false; |
190 } | 190 } |
191 | 191 |
192 } | 192 } |
OLD | NEW |