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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if (isOutOfFlowPositioned()) | 137 if (isOutOfFlowPositioned()) |
138 RenderBlock::removePositionedObject(this); | 138 RenderBlock::removePositionedObject(this); |
139 } | 139 } |
140 | 140 |
141 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
e) | 141 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
e) |
142 { | 142 { |
143 RenderStyle* oldStyle = style(); | 143 RenderStyle* oldStyle = style(); |
144 if (oldStyle) { | 144 if (oldStyle) { |
145 // The background of the root element or the body element could propagat
e up to | 145 // The background of the root element or the body element could propagat
e up to |
146 // the canvas. Just dirty the entire canvas when our style changes subst
antially. | 146 // the canvas. Just dirty the entire canvas when our style changes subst
antially. |
147 if ((diff.needsRepaint() || diff.needsLayout()) && node() | 147 if ((diff.needsPaintInvalidation() || diff.needsLayout()) && node() |
148 && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { | 148 && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { |
149 view()->paintInvalidationForWholeRenderer(); | 149 view()->paintInvalidationForWholeRenderer(); |
150 | 150 |
151 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) | 151 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) |
152 view()->compositor()->setNeedsUpdateFixedBackground(); | 152 view()->compositor()->setNeedsUpdateFixedBackground(); |
153 } | 153 } |
154 | 154 |
155 // When a layout hint happens and an object's position style changes, we
have to do a layout | 155 // When a layout hint happens and an object's position style changes, we
have to do a layout |
156 // to dirty the render tree using the old position value now. | 156 // to dirty the render tree using the old position value now. |
157 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { | 157 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(
); | 204 left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(
); |
205 layer()->scrollableArea()->scrollToXOffset(left); | 205 layer()->scrollableArea()->scrollToXOffset(left); |
206 } | 206 } |
207 if (int top = layer()->scrollableArea()->scrollYOffset()) { | 207 if (int top = layer()->scrollableArea()->scrollYOffset()) { |
208 top = (top / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(); | 208 top = (top / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(); |
209 layer()->scrollableArea()->scrollToYOffset(top); | 209 layer()->scrollableArea()->scrollToYOffset(top); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 // Our opaqueness might have changed without triggering layout. | 213 // Our opaqueness might have changed without triggering layout. |
214 if (diff.needsRepaint()) { | 214 if (diff.needsPaintInvalidation()) { |
215 RenderObject* parentToInvalidate = parent(); | 215 RenderObject* parentToInvalidate = parent(); |
216 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { | 216 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { |
217 parentToInvalidate->invalidateBackgroundObscurationStatus(); | 217 parentToInvalidate->invalidateBackgroundObscurationStatus(); |
218 parentToInvalidate = parentToInvalidate->parent(); | 218 parentToInvalidate = parentToInvalidate->parent(); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 if (isDocumentElement() || isBody()) | 222 if (isDocumentElement() || isBody()) |
223 document().view()->recalculateScrollbarOverlayStyle(); | 223 document().view()->recalculateScrollbarOverlayStyle(); |
224 | 224 |
(...skipping 4474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 4699 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
4700 { | 4700 { |
4701 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); | 4701 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); |
4702 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 4702 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
4703 ASSERT(hasBackground == style.hasBackground()); | 4703 ASSERT(hasBackground == style.hasBackground()); |
4704 hasBorder = style.hasBorder(); | 4704 hasBorder = style.hasBorder(); |
4705 hasAppearance = style.hasAppearance(); | 4705 hasAppearance = style.hasAppearance(); |
4706 } | 4706 } |
4707 | 4707 |
4708 } // namespace blink | 4708 } // namespace blink |
OLD | NEW |