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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 RenderObject::styleWillChange(diff, newStyle); | 118 RenderObject::styleWillChange(diff, newStyle); |
119 } | 119 } |
120 | 120 |
121 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
yle* oldStyle) | 121 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
yle* oldStyle) |
122 { | 122 { |
123 bool hadTransform = hasTransform(); | 123 bool hadTransform = hasTransform(); |
124 bool hadLayer = hasLayer(); | |
125 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); | |
126 | 124 |
127 RenderObject::styleDidChange(diff, oldStyle); | 125 RenderObject::styleDidChange(diff, oldStyle); |
128 updateFromStyle(); | 126 updateFromStyle(); |
129 | 127 |
130 LayerType type = layerTypeRequired(); | 128 LayerType type = layerTypeRequired(); |
131 if (type != NoLayer) { | 129 if (type != NoLayer) { |
132 if (!layer() && layerCreationAllowedForSubtree()) { | 130 if (!layer() && layerCreationAllowedForSubtree()) { |
133 if (s_wasFloating && isFloating()) | 131 if (s_wasFloating && isFloating()) |
134 setChildNeedsLayout(); | 132 setChildNeedsLayout(); |
135 createLayer(type); | 133 createLayer(type); |
(...skipping 18 matching lines...) Expand all Loading... |
154 if (s_wasFloating && isFloating()) | 152 if (s_wasFloating && isFloating()) |
155 setChildNeedsLayout(); | 153 setChildNeedsLayout(); |
156 if (hadTransform) | 154 if (hadTransform) |
157 setNeedsLayoutAndPrefWidthsRecalc(); | 155 setNeedsLayoutAndPrefWidthsRecalc(); |
158 } | 156 } |
159 | 157 |
160 if (layer()) { | 158 if (layer()) { |
161 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer | 159 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer |
162 // from the style. | 160 // from the style. |
163 layer()->setLayerType(type); | 161 layer()->setLayerType(type); |
164 | |
165 layer()->styleChanged(diff, oldStyle); | 162 layer()->styleChanged(diff, oldStyle); |
166 if (hadLayer && layer()->isSelfPaintingLayer() != layerWasSelfPainting) | |
167 setChildNeedsLayout(); | |
168 } | 163 } |
169 | 164 |
170 if (FrameView *frameView = view()->frameView()) { | 165 if (FrameView *frameView = view()->frameView()) { |
171 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit
ion(); | 166 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit
ion(); |
172 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo
nstrainedPosition(); | 167 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo
nstrainedPosition(); |
173 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { | 168 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { |
174 if (newStyleIsViewportConstained && layer()) | 169 if (newStyleIsViewportConstained && layer()) |
175 frameView->addViewportConstrainedObject(this); | 170 frameView->addViewportConstrainedObject(this); |
176 else | 171 else |
177 frameView->removeViewportConstrainedObject(this); | 172 frameView->removeViewportConstrainedObject(this); |
(...skipping 29 matching lines...) Expand all Loading... |
207 return m_layer ? m_layer->hasCompositedLayerMapping() : false; | 202 return m_layer ? m_layer->hasCompositedLayerMapping() : false; |
208 } | 203 } |
209 | 204 |
210 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const | 205 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const |
211 { | 206 { |
212 return m_layer ? m_layer->groupedMapping() : 0; | 207 return m_layer ? m_layer->groupedMapping() : 0; |
213 } | 208 } |
214 | 209 |
215 } // namespace WebCore | 210 } // namespace WebCore |
216 | 211 |
OLD | NEW |