| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 addOutlineRectsForChildrenAndContinuations(rects, LayoutPoint(), outline
RectsShouldIncludeBlockVisualOverflow()); | 1074 addOutlineRectsForChildrenAndContinuations(rects, LayoutPoint(), outline
RectsShouldIncludeBlockVisualOverflow()); |
| 1075 if (!rects.isEmpty()) { | 1075 if (!rects.isEmpty()) { |
| 1076 LayoutRect outlineRect = unionRectEvenIfEmpty(rects); | 1076 LayoutRect outlineRect = unionRectEvenIfEmpty(rects); |
| 1077 outlineRect.inflate(outlineOutset); | 1077 outlineRect.inflate(outlineOutset); |
| 1078 overflowRect.unite(outlineRect); | 1078 overflowRect.unite(outlineRect); |
| 1079 } | 1079 } |
| 1080 } | 1080 } |
| 1081 return overflowRect; | 1081 return overflowRect; |
| 1082 } | 1082 } |
| 1083 | 1083 |
| 1084 void LayoutInline::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a
ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState)
const | 1084 bool LayoutInline::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a
ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState,
VisibleRectFlags visibleRectFlags) const |
| 1085 { | 1085 { |
| 1086 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances
tor)) { | 1086 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances
tor)) |
| 1087 paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect); | 1087 return paintInvalidationState->mapObjectRectToAncestor(*this, ancestor,
rect, visibleRectFlags); |
| 1088 return; | |
| 1089 } | |
| 1090 | 1088 |
| 1091 if (ancestor == this) | 1089 if (ancestor == this) |
| 1092 return; | 1090 return true; |
| 1093 | 1091 |
| 1094 bool ancestorSkipped; | 1092 bool ancestorSkipped; |
| 1095 LayoutObject* container = this->container(ancestor, &ancestorSkipped); | 1093 LayoutObject* container = this->container(ancestor, &ancestorSkipped); |
| 1096 if (!container) | 1094 if (!container) |
| 1097 return; | 1095 return true; |
| 1098 | 1096 |
| 1099 LayoutPoint topLeft = rect.location(); | 1097 LayoutPoint topLeft = rect.location(); |
| 1100 | 1098 |
| 1101 if (style()->hasInFlowPosition() && layer()) { | 1099 if (style()->hasInFlowPosition() && layer()) { |
| 1102 // Apply the in-flow position offset when invalidating a rectangle. The
layer | 1100 // Apply the in-flow position offset when invalidating a rectangle. The
layer |
| 1103 // is translated, but the layout box isn't, so we need to do this to get
the | 1101 // is translated, but the layout box isn't, so we need to do this to get
the |
| 1104 // right dirty rect. Since this is called from LayoutObject::setStyle, t
he relative position | 1102 // right dirty rect. Since this is called from LayoutObject::setStyle, t
he relative position |
| 1105 // flag on the LayoutObject has been cleared, so use the one on the styl
e(). | 1103 // flag on the LayoutObject has been cleared, so use the one on the styl
e(). |
| 1106 topLeft += layer()->offsetForInFlowPosition(); | 1104 topLeft += layer()->offsetForInFlowPosition(); |
| 1107 } | 1105 } |
| 1108 | 1106 |
| 1109 // FIXME: We ignore the lightweight clipping rect that controls use, since i
f |o| is in mid-layout, | 1107 // FIXME: We ignore the lightweight clipping rect that controls use, since i
f |o| is in mid-layout, |
| 1110 // its controlClipRect will be wrong. For overflow clip we use the values ca
ched by the layer. | 1108 // its controlClipRect will be wrong. For overflow clip we use the values ca
ched by the layer. |
| 1111 rect.setLocation(topLeft); | 1109 rect.setLocation(topLeft); |
| 1112 if (container->hasOverflowClip()) { | 1110 if (container->hasOverflowClip()) { |
| 1113 LayoutBox* containerBox = toLayoutBox(container); | 1111 LayoutBox* containerBox = toLayoutBox(container); |
| 1114 containerBox->mapScrollingContentsRectToBoxSpace(rect); | 1112 containerBox->mapScrollingContentsRectToBoxSpace(rect); |
| 1115 if (container != ancestor) | 1113 if (container != ancestor && !containerBox->applyOverflowClip(rect, visi
bleRectFlags)) |
| 1116 containerBox->applyOverflowClip(rect); | 1114 return false; |
| 1117 if (rect.isEmpty()) | |
| 1118 return; | |
| 1119 } | 1115 } |
| 1120 | 1116 |
| 1121 if (ancestorSkipped) { | 1117 if (ancestorSkipped) { |
| 1122 // If the paintInvalidationContainer is below o, then we need to map the
rect into paintInvalidationContainer's coordinates. | 1118 // If the paintInvalidationContainer is below o, then we need to map the
rect into paintInvalidationContainer's coordinates. |
| 1123 LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(conta
iner); | 1119 LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(conta
iner); |
| 1124 rect.move(-containerOffset); | 1120 rect.move(-containerOffset); |
| 1125 return; | 1121 return true; |
| 1126 } | 1122 } |
| 1127 | 1123 |
| 1128 container->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidation
State); | 1124 return container->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInval
idationState, visibleRectFlags); |
| 1129 } | 1125 } |
| 1130 | 1126 |
| 1131 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons
t | 1127 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons
t |
| 1132 { | 1128 { |
| 1133 ASSERT(container == this->container()); | 1129 ASSERT(container == this->container()); |
| 1134 | 1130 |
| 1135 LayoutSize offset; | 1131 LayoutSize offset; |
| 1136 if (isInFlowPositioned()) | 1132 if (isInFlowPositioned()) |
| 1137 offset += offsetForInFlowPosition(); | 1133 offset += offsetForInFlowPosition(); |
| 1138 | 1134 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 | 1375 |
| 1380 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1376 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const |
| 1381 { | 1377 { |
| 1382 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r, invalidationReason); | 1378 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r, invalidationReason); |
| 1383 | 1379 |
| 1384 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) | 1380 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) |
| 1385 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); | 1381 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in
validationReason); |
| 1386 } | 1382 } |
| 1387 | 1383 |
| 1388 } // namespace blink | 1384 } // namespace blink |
| OLD | NEW |