| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.needsRepaint() || diff.needsLayout()) && node() | 146 if (diff >= StyleDifferenceRepaint && node() && |
| 147 && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { | 147 (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { |
| 148 | 148 |
| 149 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || !diff.ne
edsFullLayout()) | 149 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff !=
StyleDifferenceLayout) |
| 150 view()->repaint(); | 150 view()->repaint(); |
| 151 | 151 |
| 152 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) | 152 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) |
| 153 view()->compositor()->setNeedsUpdateFixedBackground(); | 153 view()->compositor()->setNeedsUpdateFixedBackground(); |
| 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.needsFullLayout() && parent() && oldStyle->position() != newSty
le.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.hasOutOfFlo
wPosition()) | 164 if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlo
wPosition()) |
| 165 removeFloatingOrPositionedChildFromBlockLists(); | 165 removeFloatingOrPositionedChildFromBlockLists(); |
| 166 } | 166 } |
| 167 // FIXME: This branch runs when !oldStyle, which means that layout was never
called | 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? | 168 // so what's the point in invalidating the whole view that we never painted? |
| (...skipping 35 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 == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer) { |
| 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 4432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4657 return 0; | 4657 return 0; |
| 4658 | 4658 |
| 4659 if (!layoutState && !flowThreadContainingBlock()) | 4659 if (!layoutState && !flowThreadContainingBlock()) |
| 4660 return 0; | 4660 return 0; |
| 4661 | 4661 |
| 4662 RenderBlock* containerBlock = containingBlock(); | 4662 RenderBlock* containerBlock = containingBlock(); |
| 4663 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4663 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
| 4664 } | 4664 } |
| 4665 | 4665 |
| 4666 } // namespace WebCore | 4666 } // namespace WebCore |
| OLD | NEW |