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, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 if (parentBlockFlow) { | 130 if (parentBlockFlow) { |
131 parentBlockFlow->markSiblingsWithFloatsForLayout(this); | 131 parentBlockFlow->markSiblingsWithFloatsForLayout(this); |
132 parentBlockFlow->markAllDescendantsWithFloatsForLayout(this, false); | 132 parentBlockFlow->markAllDescendantsWithFloatsForLayout(this, false); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 if (isOutOfFlowPositioned()) | 136 if (isOutOfFlowPositioned()) |
137 RenderBlock::removePositionedObject(this); | 137 RenderBlock::removePositionedObject(this); |
138 } | 138 } |
139 | 139 |
140 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl e) | 140 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl e) |
141 { | 141 { |
142 RenderStyle* oldStyle = style(); | 142 RenderStyle* oldStyle = style(); |
143 if (oldStyle) { | 143 if (oldStyle) { |
144 // The background of the root element or the body element could propagat e up to | 144 // The background of the root element or the body element could propagat e up to |
145 // the canvas. Just dirty the entire canvas when our style changes subs tantially. | 145 // the canvas. Just dirty the entire canvas when our style changes subs tantially. |
146 if (diff >= StyleDifferenceRepaint && node() && | 146 if (diff >= StyleDifferenceRepaint && node() && |
147 (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { | 147 (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { |
148 | 148 |
149 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff != StyleDifferenceLayout) | 149 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff != StyleDifferenceLayout) |
150 view()->repaint(); | 150 view()->repaint(); |
151 | 151 |
152 if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyF ixedBackground()) | 152 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi xedBackground()) |
153 view()->compositor()->rootFixedBackgroundsChanged(); | 153 view()->compositor()->rootFixedBackgroundsChanged(); |
154 } | 154 } |
155 | 155 |
156 // When a layout hint happens and an object's position style changes, we have to do a layout | 156 // When a layout hint happens and an object's position style changes, we have to do a layout |
157 // to dirty the render tree using the old position value now. | 157 // to dirty the render tree using the old position value now. |
158 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) { | 158 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle.position()) { |
159 markContainingBlocksForLayout(); | 159 markContainingBlocksForLayout(); |
160 if (oldStyle->position() == StaticPosition) | 160 if (oldStyle->position() == StaticPosition) |
161 repaint(); | 161 repaint(); |
162 else if (newStyle->hasOutOfFlowPosition()) | 162 else if (newStyle.hasOutOfFlowPosition()) |
163 parent()->setChildNeedsLayout(); | 163 parent()->setChildNeedsLayout(); |
164 if (isFloating() && !isOutOfFlowPositioned() && newStyle->hasOutOfFl owPosition()) | 164 if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlo wPosition()) |
165 removeFloatingOrPositionedChildFromBlockLists(); | 165 removeFloatingOrPositionedChildFromBlockLists(); |
166 } | 166 } |
167 } else if (newStyle && isBody()) | 167 // FIXME: This branch runs when !oldStyle, which means that layout was never called |
168 // so what's the point in invalidating the whole view that we never painted? | |
esprehn
2014/03/31 20:07:51
yeah this code doesn't make any sense, you should
Julien - ping for review
2014/03/31 20:20:27
I will post a follow-up patch for that to keep thi
| |
169 } else if (isBody()) | |
168 view()->repaint(); | 170 view()->repaint(); |
169 | 171 |
170 RenderBoxModelObject::styleWillChange(diff, newStyle); | 172 RenderBoxModelObject::styleWillChange(diff, newStyle); |
171 } | 173 } |
172 | 174 |
173 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle ) | 175 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle ) |
174 { | 176 { |
175 // Horizontal writing mode definition is updated in RenderBoxModelObject::up dateFromStyle, | 177 // Horizontal writing mode definition is updated in RenderBoxModelObject::up dateFromStyle, |
176 // (as part of the RenderBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal | 178 // (as part of the RenderBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal |
177 // writing mode value before style change here. | 179 // writing mode value before style change here. |
(...skipping 4483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4661 return 0; | 4663 return 0; |
4662 | 4664 |
4663 if (!layoutState && !flowThreadContainingBlock()) | 4665 if (!layoutState && !flowThreadContainingBlock()) |
4664 return 0; | 4666 return 0; |
4665 | 4667 |
4666 RenderBlock* containerBlock = containingBlock(); | 4668 RenderBlock* containerBlock = containingBlock(); |
4667 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4669 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4668 } | 4670 } |
4669 | 4671 |
4670 } // namespace WebCore | 4672 } // namespace WebCore |
OLD | NEW |