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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 setNeedsLayoutAndPrefWidthsRecalc(); | 2056 setNeedsLayoutAndPrefWidthsRecalc(); |
2057 else if (updatedDiff.needsPositionedMovementLayout()) | 2057 else if (updatedDiff.needsPositionedMovementLayout()) |
2058 setNeedsPositionedMovementLayout(); | 2058 setNeedsPositionedMovementLayout(); |
2059 } | 2059 } |
2060 | 2060 |
2061 if (diff.transformChanged() && !needsLayout()) { | 2061 if (diff.transformChanged() && !needsLayout()) { |
2062 if (RenderBlock* container = containingBlock()) | 2062 if (RenderBlock* container = containingBlock()) |
2063 container->setNeedsOverflowRecalcAfterStyleChange(); | 2063 container->setNeedsOverflowRecalcAfterStyleChange(); |
2064 } | 2064 } |
2065 | 2065 |
2066 if (updatedDiff.needsRepaintLayer()) { | 2066 if (updatedDiff.needsRepaintLayer()) |
2067 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio
nIncludingNonCompositingDescendants(); | 2067 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio
nIncludingNonCompositingDescendants(); |
2068 } else if (updatedDiff.needsRepaint()) { | 2068 else if (diff.needsRepaintObject() || updatedDiff.needsRepaintObject()) |
2069 // Invalidate paints with the new style, e.g., for example if we go from
not having | 2069 setShouldDoFullPaintInvalidation(true); |
2070 // an outline to having an outline. | |
2071 | |
2072 // The paintInvalidationForWholeRenderer() call is needed for non-layout
changes to style. See the corresponding | |
2073 // comment in RenderObject::styleWillChange for why. | |
2074 if (needsLayout()) | |
2075 setShouldDoFullPaintInvalidation(true); | |
2076 else if (!selfNeedsLayout()) | |
2077 paintInvalidationForWholeRenderer(); | |
2078 } | |
2079 } | 2070 } |
2080 | 2071 |
2081 static inline bool rendererHasBackground(const RenderObject* renderer) | 2072 static inline bool rendererHasBackground(const RenderObject* renderer) |
2082 { | 2073 { |
2083 return renderer && renderer->hasBackground(); | 2074 return renderer && renderer->hasBackground(); |
2084 } | 2075 } |
2085 | 2076 |
2086 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
tyle) | 2077 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
tyle) |
2087 { | 2078 { |
2088 if (m_style) { | 2079 if (m_style) { |
(...skipping 13 matching lines...) Expand all Loading... |
2102 // We might not have an enclosing layer yet because we might not be
in the tree. | 2093 // We might not have an enclosing layer yet because we might not be
in the tree. |
2103 if (RenderLayer* layer = enclosingLayer()) { | 2094 if (RenderLayer* layer = enclosingLayer()) { |
2104 if (newStyle.visibility() == VISIBLE) { | 2095 if (newStyle.visibility() == VISIBLE) { |
2105 layer->setHasVisibleContent(); | 2096 layer->setHasVisibleContent(); |
2106 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { | 2097 } else if (layer->hasVisibleContent() && (this == layer->rendere
r() || layer->renderer()->style()->visibility() != VISIBLE)) { |
2107 layer->dirtyVisibleContentStatus(); | 2098 layer->dirtyVisibleContentStatus(); |
2108 } | 2099 } |
2109 } | 2100 } |
2110 } | 2101 } |
2111 | 2102 |
2112 // For style-only changes that need paint invalidation, we currently nee
d to issue a paint invalidation before and after the style | |
2113 // change. The paint invalidation before style change is accomplished he
re. The paint invalidation after style change is accomplished | |
2114 // in RenderObject::setStyle. | |
2115 if (m_parent && diff.needsRepaintObject()) { | |
2116 if (!diff.needsLayout() && !needsLayout()) | |
2117 paintInvalidationForWholeRenderer(); | |
2118 } | |
2119 | |
2120 if (isFloating() && (m_style->floating() != newStyle.floating())) | 2103 if (isFloating() && (m_style->floating() != newStyle.floating())) |
2121 // For changes in float styles, we need to conceivably remove oursel
ves | 2104 // For changes in float styles, we need to conceivably remove oursel
ves |
2122 // from the floating objects list. | 2105 // from the floating objects list. |
2123 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2106 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2124 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) | 2107 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos
ition())) |
2125 // For changes in positioning styles, we need to conceivably remove
ourselves | 2108 // For changes in positioning styles, we need to conceivably remove
ourselves |
2126 // from the positioned objects list. | 2109 // from the positioned objects list. |
2127 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); | 2110 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); |
2128 | 2111 |
2129 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() | 2112 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() |
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3459 { | 3442 { |
3460 if (object1) { | 3443 if (object1) { |
3461 const blink::RenderObject* root = object1; | 3444 const blink::RenderObject* root = object1; |
3462 while (root->parent()) | 3445 while (root->parent()) |
3463 root = root->parent(); | 3446 root = root->parent(); |
3464 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3447 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3465 } | 3448 } |
3466 } | 3449 } |
3467 | 3450 |
3468 #endif | 3451 #endif |
OLD | NEW |