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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
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 if ((diff.needsRepaint() || diff.needsLayout()) && backgroundCanBleedToC
anvas()) { | 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. |
| 147 if ((diff.needsRepaint() || diff.needsLayout()) && node() |
| 148 && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) { |
| 149 view()->paintInvalidationForWholeRenderer(); |
| 150 |
146 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) | 151 if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFi
xedBackground()) |
147 view()->compositor()->setNeedsUpdateFixedBackground(); | 152 view()->compositor()->setNeedsUpdateFixedBackground(); |
148 } | 153 } |
149 | 154 |
150 // 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 |
151 // to dirty the render tree using the old position value now. | 156 // to dirty the render tree using the old position value now. |
152 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { | 157 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { |
153 markContainingBlocksForLayout(); | 158 markContainingBlocksForLayout(); |
154 if (oldStyle->position() == StaticPosition) | 159 if (oldStyle->position() == StaticPosition) |
155 paintInvalidationForWholeRenderer(); | 160 paintInvalidationForWholeRenderer(); |
156 else if (newStyle.hasOutOfFlowPosition()) | 161 else if (newStyle.hasOutOfFlowPosition()) |
157 parent()->setChildNeedsLayout(); | 162 parent()->setChildNeedsLayout(); |
158 if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlo
wPosition()) | 163 if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlo
wPosition()) |
159 removeFloatingOrPositionedChildFromBlockLists(); | 164 removeFloatingOrPositionedChildFromBlockLists(); |
160 } | 165 } |
| 166 // FIXME: This branch runs when !oldStyle, which means that layout was never
called |
| 167 // so what's the point in invalidating the whole view that we never painted? |
| 168 } else if (isBody()) { |
| 169 view()->paintInvalidationForWholeRenderer(); |
161 } | 170 } |
162 | 171 |
163 RenderBoxModelObject::styleWillChange(diff, newStyle); | 172 RenderBoxModelObject::styleWillChange(diff, newStyle); |
164 } | 173 } |
165 | 174 |
166 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
) | 175 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
) |
167 { | 176 { |
168 // Horizontal writing mode definition is updated in RenderBoxModelObject::up
dateFromStyle, | 177 // Horizontal writing mode definition is updated in RenderBoxModelObject::up
dateFromStyle, |
169 // (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 |
170 // writing mode value before style change here. | 179 // writing mode value before style change here. |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 ASSERT(m_rareData); | 1954 ASSERT(m_rareData); |
1946 m_rareData->m_inlineBoxWrapper = 0; | 1955 m_rareData->m_inlineBoxWrapper = 0; |
1947 } | 1956 } |
1948 } | 1957 } |
1949 | 1958 |
1950 LayoutRect RenderBox::clippedOverflowRectForPaintInvalidation(const RenderLayerM
odelObject* paintInvalidationContainer, const PaintInvalidationState* paintInval
idationState) const | 1959 LayoutRect RenderBox::clippedOverflowRectForPaintInvalidation(const RenderLayerM
odelObject* paintInvalidationContainer, const PaintInvalidationState* paintInval
idationState) const |
1951 { | 1960 { |
1952 if (style()->visibility() != VISIBLE && enclosingLayer()->subtreeIsInvisible
()) | 1961 if (style()->visibility() != VISIBLE && enclosingLayer()->subtreeIsInvisible
()) |
1953 return LayoutRect(); | 1962 return LayoutRect(); |
1954 | 1963 |
1955 // If we have a background that could bleed into the canvas, just return | |
1956 // the viewport's rectangle. This works as only body and the document | |
1957 // element's renderer can bleed into the viewport so we are guaranteed | |
1958 // to be in the RenderView's coordinate space. | |
1959 if (style()->hasBackground() && backgroundCanBleedToCanvas()) | |
1960 return view()->viewRect(); | |
1961 | |
1962 LayoutRect r = visualOverflowRect(); | 1964 LayoutRect r = visualOverflowRect(); |
1963 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, false /*fix
ed*/, paintInvalidationState); | 1965 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, false /*fix
ed*/, paintInvalidationState); |
1964 return r; | 1966 return r; |
1965 } | 1967 } |
1966 | 1968 |
1967 void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidatio
nState* paintInvalidationState) const | 1969 void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidatio
nState* paintInvalidationState) const |
1968 { | 1970 { |
1969 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. | 1971 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. |
1970 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate | 1972 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate |
1971 // offset corner for the enclosing container). This allows for a fully RL o
r BT document to repaint | 1973 // offset corner for the enclosing container). This allows for a fully RL o
r BT document to repaint |
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4666 | 4668 |
4667 // We need the old border box size only when the box has background or b
ox decorations. | 4669 // We need the old border box size only when the box has background or b
ox decorations. |
4668 if (!style()->hasBackground() && !style()->hasBoxDecorations()) | 4670 if (!style()->hasBackground() && !style()->hasBoxDecorations()) |
4669 return; | 4671 return; |
4670 } | 4672 } |
4671 | 4673 |
4672 ensureRareData().m_previousBorderBoxSize = size(); | 4674 ensureRareData().m_previousBorderBoxSize = size(); |
4673 } | 4675 } |
4674 | 4676 |
4675 } // namespace blink | 4677 } // namespace blink |
OLD | NEW |