OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. | 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 layer()->clipper().clearClipRectsIncludingDescendants(); | 97 layer()->clipper().clearClipRectsIncludingDescendants(); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 RenderObject::styleWillChange(diff, newStyle); | 101 RenderObject::styleWillChange(diff, newStyle); |
102 } | 102 } |
103 | 103 |
104 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
yle* oldStyle) | 104 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
yle* oldStyle) |
105 { | 105 { |
106 bool hadTransform = hasTransform(); | 106 bool hadTransform = hasTransform(); |
| 107 bool hadLayer = hasLayer(); |
| 108 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); |
107 | 109 |
108 RenderObject::styleDidChange(diff, oldStyle); | 110 RenderObject::styleDidChange(diff, oldStyle); |
109 updateFromStyle(); | 111 updateFromStyle(); |
110 | 112 |
111 LayerType type = layerTypeRequired(); | 113 LayerType type = layerTypeRequired(); |
112 if (type != NoLayer) { | 114 if (type != NoLayer) { |
113 if (!layer() && layerCreationAllowedForSubtree()) { | 115 if (!layer() && layerCreationAllowedForSubtree()) { |
114 if (s_wasFloating && isFloating()) | 116 if (s_wasFloating && isFloating()) |
115 setChildNeedsLayout(); | 117 setChildNeedsLayout(); |
116 createLayer(type); | 118 createLayer(type); |
(...skipping 12 matching lines...) Expand all Loading... |
129 if (s_wasFloating && isFloating()) | 131 if (s_wasFloating && isFloating()) |
130 setChildNeedsLayout(); | 132 setChildNeedsLayout(); |
131 if (hadTransform) | 133 if (hadTransform) |
132 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 134 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
133 } | 135 } |
134 | 136 |
135 if (layer()) { | 137 if (layer()) { |
136 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer | 138 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer |
137 // from the style. | 139 // from the style. |
138 layer()->setLayerType(type); | 140 layer()->setLayerType(type); |
| 141 |
139 layer()->styleChanged(diff, oldStyle); | 142 layer()->styleChanged(diff, oldStyle); |
| 143 if (hadLayer && layer()->isSelfPaintingLayer() != layerWasSelfPainting) |
| 144 setChildNeedsLayout(); |
140 } | 145 } |
141 | 146 |
142 if (FrameView *frameView = view()->frameView()) { | 147 if (FrameView *frameView = view()->frameView()) { |
143 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit
ion(); | 148 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit
ion(); |
144 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo
nstrainedPosition(); | 149 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo
nstrainedPosition(); |
145 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { | 150 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { |
146 if (newStyleIsViewportConstained && layer()) | 151 if (newStyleIsViewportConstained && layer()) |
147 frameView->addViewportConstrainedObject(this); | 152 frameView->addViewportConstrainedObject(this); |
148 else | 153 else |
149 frameView->removeViewportConstrainedObject(this); | 154 frameView->removeViewportConstrainedObject(this); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); | 205 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); |
201 | 206 |
202 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); | 207 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); |
203 if (reason == InvalidationLocationChange || reason == InvalidationFull) | 208 if (reason == InvalidationLocationChange || reason == InvalidationFull) |
204 childTreeWalkState.setForceCheckForPaintInvalidation(); | 209 childTreeWalkState.setForceCheckForPaintInvalidation(); |
205 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | 210 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); |
206 } | 211 } |
207 | 212 |
208 } // namespace blink | 213 } // namespace blink |
209 | 214 |
OLD | NEW |